OFFSET
1,1
LINKS
The prime puzzles, Puzzle 659
PROG
(PARI) a(n)=my(p, t, v, k, j, d, N=n-1); if(n==1, 6, if(n==2, 0, t=9*10^(N\2); d=6*11^(N%2); forstep(k=t, 0, -1, v=digits(k); v=concat(v, vecextract(Vecrev(v), concat(Str((N+1)%2+1), ".."))); p=subst(Pol(v), x, 10); if(p%d==0&&ispseudoprime(p+1)&&ispseudoprime(p-1), return(p)))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Igor Schein, Oct 26 2012
STATUS
approved