OFFSET
1,1
PROG
(Python)
from sympy import sieve
from sympy.ntheory import is_palindromic
def a086757(n): return next(p for p in sieve if is_palindromic(n, p)) # Dumitru Damian, Jan 29 2024
(PARI) isok(p, n) = my(d=digits(n, p)); d == Vecrev(d);
a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Jan 30 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Aug 01 2003
STATUS
approved