OFFSET
1,1
COMMENTS
Conjecture: Sequence is infinite.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
353 is a term as 1000 - 353 = 647 is also prime.
MATHEMATICA
Do[p = Prime[n]; If[FromDigits[Reverse[IntegerDigits[p]]] == p && PrimeQ[10^Length[IntegerDigits[p]] - p], Print[p]], {n, 1, 10^6}] (* Ryan Propper, Sep 01 2005 *)
PROG
(Python)
from sympy import isprime
from itertools import product
def tc(n): return 10**len(str(n)) - n
def cond(p): return isprime(p) and isprime(tc(p))
def palcands(digs):
if digs == 1: yield from [2, 3, 5, 7]; return
if digs%2 == 0: yield from [[], [11]][digs==2]; return
for first in "1379":
for p in product("0123456789", repeat=(digs-2)//2):
left = first + "".join(p)
for mid in "0123456789": yield int(left + mid + left[::-1])
def auptod(digs):
return [p for d in range(1, digs+1) for p in palcands(d) if cond(p)]
print(auptod(7)) # Michael S. Branicky, Jul 05 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Jul 08 2005
EXTENSIONS
More terms from Ryan Propper, Sep 01 2005
a(37) and beyond from Michael S. Branicky, Jul 05 2021
STATUS
approved