login
A375261
Smallest n-digit reversible prime with only prime digits.
0
2, 37, 337, 3257, 32233, 322573, 3222223, 32235223, 322222223, 3222222257, 32222232577, 322222232537, 3222222223333, 32222222332733, 322222222237537, 3222222222223373, 32222222222223353, 322222222222225333, 3222222222222222577, 32222222222222225573, 322222222222222233253
OFFSET
1,1
FORMULA
a(n) <= A177513(n) for n > 1.
if a(n) is not a palindrome, a(n) = A177513(n) for n > 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
Sequence in context: A200911 A243101 A001569 * A373618 A092853 A297796
KEYWORD
base,nonn
AUTHOR
Jean-Marc Rebert, Aug 08 2024
STATUS
approved