OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..500
Patrick De Geest, World!Of Palindromic Primes.
MATHEMATICA
t={}; Do[p=NextPrime[10^(2*n)]; While[Reverse[x=IntegerDigits[p]]!=x, p=NextPrime[p]]; AppendTo[t, p], {n, 0, 6}]; t (* Jayanta Basu, Jun 05 2013 *)
PROG
(PARI) a(n)={
n--;
my(N=100^n+1, aS=10^(n+3)+10^(n-3), bS=10^(n+2)+10^(n-2), cS=10^(n+1)+10^(n-1), dS=10^n);
forstep(a=N, N+9*aS, aS,
forstep(b=a, a+9*bS, bS,
forstep(c=b, b+9*cS, cS,
forstep(d=c, c+9*dS, dS,
if(ispseudoprime(d), return(d))
))));
warning("could not find a("n")")
}; \\ Charles R Greathouse IV, Feb 15 2011
(PARI) a(n)=for(j=10^(n-1), 10^n-1, d=digits(j); p=fromdigits(vector(2*n-1, x, if(x<n, d[x], d[2*n-x]))); ispseudoprime(p)&&return(p)); 0 \\ Jeppe Stig Nielsen, Feb 20 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
a(10) corrected by Farideh Firoozbakht, Oct 10 2005
STATUS
approved