|
|
A225193
|
|
Composite numbers such that every non-identity permutation gives a prime.
|
|
0
|
|
|
14, 16, 20, 30, 32, 34, 35, 38, 50, 70, 74, 76, 91, 92, 95, 98, 110, 118, 119, 133, 772, 775, 778, 779, 1118, 3337, 7771, 77779
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
772 is a member since both 727 and 277 are primes.
|
|
MATHEMATICA
|
t={}; Do[p=Permutations[IntegerDigits[n]]; c=Length[p]; cn=Length[Select[Table[FromDigits[k], {k, p}], PrimeQ]]; If[!PrimeQ[n] && c>1 && cn==c-1, AppendTo[t, n]], {n, 10, 100000}]; t
|
|
PROG
|
(Python)
from sympy import isprime
from itertools import count, islice, permutations
def agen(): yield from (k for k in count(1) if len(set(s:=str(k)))!=1 and not isprime(k) and all((t:=int("".join(m)))==k or isprime(t) for m in permutations(s)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|