Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Jul 11 2024 16:53:30
%S 2,3,7,5,11,7,727,383,727,757,727,787,929,72727,30103,30703,32323,
%T 34543,36563,38183,38783,72727,78487,70507,72727,74747,76367,78787,
%U 1242421,90709,94349,94949,96769,98389,1412141,1242421,1832381,9923299,7278727
%N Palindromes in A087386.
%H Chai Wah Wu, <a href="/A087387/b087387.txt">Table of n, a(n) for n = 1..10000</a>
%e Prime corresponding to the palindrome 121 is 727.
%o (Python)
%o from itertools import count, islice
%o from sympy import isprime
%o def A087387_gen(): # generator of terms
%o for n in count(2):
%o 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)
%o r = next(p for p in count(q+1,q) if isprime(p))
%o if(s:=str(r))[:(t:=len(s)+1>>1)]==s[:-t-1:-1]:
%o yield r
%o A087387_list = list(islice(A087387_gen(),20)) # _Chai Wah Wu_, Jul 11 2024
%Y Cf. A087386.
%K base,nonn
%O 1,1
%A _Amarnath Murthy_, Sep 09 2003
%E More terms from _David Wasserman_, May 25 2005