OFFSET
1,1
COMMENTS
All the primes containing a 0 are members since a 0 cannot be added at the end (it is even) nor at the beginning since, for example, 02 and 0013 are not canonical representations. The sequence is infinite, since there are exactly 820293 other primes that can be reached from 2, the largest one being 5481899436575987524681453773937333.
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
Carlos Rivera, Puzzle 690 - Unreachable Primes
EXAMPLE
All the primes < 89 can be reached from 2. For example, 2 -> 23 -> 3 -> 37.
MATHEMATICA
step[p_] := Block[{dn = 10^IntegerLength@p}, Select[ Union[{Floor[p/10], Mod[p, dn/10]}, p*10 + {1, 3, 7, 9}, Range[9]*dn + p], PrimeQ[#] &]]; old = {}; new = {2}; wrk = {}; While[new != {}, wrk = Flatten[step /@ new]; old = Union[new, old]; new = Complement[wrk, old]; Print["# = ", Length@old, " max = ", Max[old], " new # = ", Length@new]]; Print["Missing up to 1000 = ", Complement[Prime@Range[168], old]]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Jun 01 2013
STATUS
approved