OFFSET
1,1
COMMENTS
In sequence A004185 these are referred to as "sortable primes". Nontrivial terms (with digits not in nondecreasing order) are listed in A086042. - M. F. Hasler, Jul 30 2019.
LINKS
Francis J. McDonnell, Table of n, a(n) for n = 1..10000
Francis J. McDonnell, Java Program
EXAMPLE
173 is prime and after the digits are sorted into nondecreasing order we obtain 137, which is prime.
MATHEMATICA
Select[Prime[Range[200]], PrimeQ[FromDigits[Sort[IntegerDigits[#]]]] &] (* T. D. Noe, Apr 17 2012 *)
PROG
(PARI) select( is_A211654(p)={isprime(fromdigits(vecsort(digits(p))))&&isprime(p)}, primes([1, 999])) \\ M. F. Hasler, Jul 30 2019
(Magma) [p:p in PrimesUpTo(400)| IsPrime(Seqint(Reverse(Sort(Intseq(p, 10)))))]; // Marius A. Burtea, Jul 30 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Francis J. McDonnell, Apr 17 2012
STATUS
approved