|
|
A109863
|
|
Primes arising as the 10's complement of A109862(n).
|
|
2
|
|
|
7, 5, 3, 89, 809, 647, 617, 71, 89399, 88589, 87179, 86069, 85259, 84449, 83939, 83639, 83339, 82529, 69197, 67577, 66467, 63737, 27773, 25253, 24443, 23633, 23333, 6761, 5651, 5351, 5051, 2621, 8971799, 8925299, 8917199, 8699969, 8671769, 8543459, 8491949
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(n) - 1 is a palindrome. Obviously 7, 5 and 3 are the only palindromic terms. Conjecture: Sequence is infinite.
|
|
LINKS
|
|
|
EXAMPLE
|
353 is a member of A109862 and 647 = 1000 - 353 corresponds to it.
|
|
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 [tc(p) for d in range(1, digs+1) for p in palcands(d) if cond(p)]
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|