login
A087387
Palindromes in A087386.
2
2, 3, 7, 5, 11, 7, 727, 383, 727, 757, 727, 787, 929, 72727, 30103, 30703, 32323, 34543, 36563, 38183, 38783, 72727, 78487, 70507, 72727, 74747, 76367, 78787, 1242421, 90709, 94349, 94949, 96769, 98389, 1412141, 1242421, 1832381, 9923299, 7278727
OFFSET
1,1
EXAMPLE
Prime corresponding to the palindrome 121 is 727.
PROG
(Python)
from itertools import count, islice
from sympy import isprime
def A087387_gen(): # generator of terms
for n in count(2):
q =(c:=n-x)*x+int(str(c)[-2::-1] or 0) if n<(x:=10**(len(str(n>>1))-1))+(y:=10*x) else (c:=n-y)*y+int(str(c)[::-1] or 0)
r = next(p for p in count(q+1, q) if isprime(p))
if(s:=str(r))[:(t:=len(s)+1>>1)]==s[:-t-1:-1]:
yield r
A087387_list = list(islice(A087387_gen(), 20)) # Chai Wah Wu, Jul 11 2024
CROSSREFS
Cf. A087386.
Sequence in context: A110359 A092977 A057218 * A275205 A327093 A171039
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 09 2003
EXTENSIONS
More terms from David Wasserman, May 25 2005
STATUS
approved