login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A109862
Palindromic primes p such that p's 10's complement is also a prime.
2
3, 5, 7, 11, 191, 353, 383, 929, 10601, 11411, 12821, 13931, 14741, 15551, 16061, 16361, 16661, 17471, 30803, 32423, 33533, 36263, 72227, 74747, 75557, 76367, 76667, 93239, 94349, 94649, 94949, 97379, 1028201, 1074701, 1082801, 1300031, 1328231, 1456541, 1508051
OFFSET
1,1
COMMENTS
Conjecture: Sequence is infinite.
LINKS
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
Cf. A109863.
Sequence in context: A159471 A068113 A068831 * A069804 A245722 A262962
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