OFFSET
1,1
PROG
(Python)
from sympy import isprime
from itertools import product
def a(n):
if n == 1: return 2
for first in "37":
for rest in product("2357", repeat=n-1):
s = first + "".join(rest)
if isprime(t:=int(s)) and isprime(int(s[::-1])):
return t
print([a(n) for n in range(1, 22)]) # Michael S. Branicky, Aug 08 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jean-Marc Rebert, Aug 08 2024
STATUS
approved