OFFSET
1,1
COMMENTS
If a prime p belongs to the sequence, then every prime digit permutation of p (excluding some primes with a leading zero) also belongs to the sequence.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..4137 (terms 1..1049 from Jean-Marc Rebert)
EXAMPLE
127 is a term because the concatenation, in ascending order, of all prime permutations of its digits (namely, 127 and 271) yields 127271, which is also prime.
1019 is a term because the concatenation, in ascending order, of all prime permutations of its digits (namely, 191, 911, 1019, 1091, 1109, 1901 and 9011) yields 19191110191091110919019011, which is also prime.
13 is not a term since 1331 = 11^3 is not prime.
MATHEMATICA
Select[Prime[Range[120]], PrimeQ[FromDigits[IntegerDigits[Sort[Select[FromDigits/@Permutations[IntegerDigits[#]], PrimeQ]]]//Flatten]]&] (* James C. McMahon, Dec 02 2025 *)
PROG
(Python)
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
def ok(n): return isprime(n) and isprime(int("".join(str(t) for p in multiset_permutations(str(n)) if isprime(t:=int("".join(p))))))
print([k for k in range(700) if ok(k)]) # Michael S. Branicky, Nov 15 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jean-Marc Rebert, Nov 15 2025
STATUS
approved
