OFFSET
1,1
COMMENTS
All terms except for the initial 2 start and end in the digit 1.
PROG
(PARI) allow=Vec("012"); forprime(p=1, default(primelimit), setminus( Set( Vec(Str( p ))), allow)&next; isprime(A004086(p))&print1(p", ")) /* better use the much more efficient code below */
(PARI) a(n=50, list=0, L=[0, 1, 2], needpal=1)={ for(d=1, 1e9, u=vector(d, i, 10^(d-i))~; forvec(v=vector(d, i, [1+(i==1&!L[1]), #L]), isprime(t=vector(d, i, L[v[i]])*u) || next; needpal & !isprime(A004086(t)) & next; list & print1(t", "); n-- || return(t)))} \\ M. F. Hasler, Nov 06 2011
(Magma) [p: p in PrimesUpTo(10^8) | Set(Intseq(p)) subset [0..2] and IsPrime(Seqint(Reverse(Intseq(p))))]; // Bruno Berselli, Nov 07 2011
(Python)
from itertools import count, islice, product
from sympy import isprime
def A199302_gen(): return (n for n in (int(t+''.join(s)) for l in count(0) for t in '12' for s in product('012', repeat=l)) if isprime(n) and isprime(int(str(n)[::-1])))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 04 2011
STATUS
approved