OFFSET
0,2
COMMENTS
LINKS
Lars Blomberg, Table of n, a(n) for n = 0..9999
E. Angelini, Two make a prime, Nov 09 2013
EXAMPLE
Start with a(0)=0. The least prime having this digit is 101, so a(1)=11. Since 0 cannot be used any more and 111 is not a prime, the least digit that can be added to get the digits of some prime (namely 211) is a(2)=2, then a(3)=3 yields 23, etc.
See also the link to Angelini's post.
PROG
(PARI) {a=u=0; for(n=1, 99, u+=1<<a; print1(a", "); for(k=1, 9e9, bittest(u, k)&&next; d=Vec(Str(a, k)); for(p=0, (#d)!-1, isprime(eval(concat(t=vecextract(d, numtoperm(#d, p)))))&&t[1]>"0"&&(a=k)&&next(3))))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Nov 09 2013
STATUS
approved