OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
61=221_5 is in the sequence since it is a prime and each of its base-5 suffixes (21_5=11 and 1_5=1) is either prime or 1.
PROG
(PARI) expand(v, d)=my(u=List(v), D=5^d); forstep(x=D, 4*D, D, for(i=1, #v, if(isprime(t=x+v[i]), listput(u, t)))); Vec(u)
list(lim)=my(v=[1, 2, 3]); for(n=1, #digits(lim\=1, 5)-1, v=expand(v, n)); select(k->k<=lim && k>1, v) \\ Charles R Greathouse IV, Nov 26 2016
(PARI) isok(n) = {if (isprime(n), pp = 5^logint(n, 5); while ((isprime(rem=(n % pp)) || (rem == 1)) && (pp != 1), pp = pp/5); pp == 1; ); } \\ Michel Marcus, Nov 26 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Randy L. Ekl, Nov 26 2016
STATUS
approved