OFFSET
1,1
EXAMPLE
Prime corresponding to the palindrome 121 is 727.
PROG
(Python)
from itertools import count
from sympy import isprime
def A087386(n):
q =(c:=n+1-x)*x+int(str(c)[-2::-1] or 0) if n+1<(x:=10**(len(str(n+1>>1))-1))+(y:=10*x) else (c:=n+1-y)*y+int(str(c)[::-1] or 0)
return next(p for p in count(q+1, q) if isprime(p)) # Chai Wah Wu, Jul 11 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 09 2003
EXTENSIONS
More terms from David Wasserman, May 25 2005
STATUS
approved