OFFSET
1,1
COMMENTS
This is a finite sequence since at a(14) there is no way to add 2 more digits and reach a palindromic prime.
EXAMPLE
As a triangle:
3
10301
101030101
1210103010121
12121010301012121
PROG
(Python)
from sympy import isprime
from itertools import product
def agen(): # generator of terms
an, s = 3, "3"
while an > 0:
yield an
an = -1
for f, r in product("1379", "0123456789"):
sn = f+r+s+r+f
if isprime(t:=int(sn)):
an, s = t, sn
break
print(list(agen())) # Michael S. Branicky, Aug 25 2024
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Shyam Sunder Gupta, Aug 24 2024
STATUS
approved
