OFFSET
1,1
COMMENTS
Any prime number p >= 10^11 has necessarily a duplicate digit, say that appears at positions i and j. Applying the nontrivial permutation (i j) to the digits of p yields a prime number (p itself), hence p does not belong to the sequence and the sequence is finite.
EXAMPLE
The nontrivial permutations of the digits of 607 (not permitting leading zeros) are:
670 = 2 * 5 * 67,
706 = 2 * 353,
760 = 2^3 * 5 * 19,
so 607 belongs to the sequence.
PROG
(PARI) is(p) = { my (d=digits(p)); if (#d > #Set(d), return (0), forperm (vecsort(d), t, if (t[1], my (q=fromdigits(Vec(t))); if (p!=q && isprime(q), return (0)))); return (1)) }
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Rémy Sigrist, Jan 23 2023
STATUS
approved