OFFSET

1,1

COMMENTS

This sequence doesn't contain any numbers with an even number of digits, see proof in A356824.

Subsequence of A356824.

All numbers in this sequence are even. Proof: any two consecutive multi-digit palindromes differ by at least 10, so larger palindromes can't be the sum of a palindromic prime and 2. Thus, each term is the sum of two odd numbers.

EXAMPLE

282 can be expressed as a sum of two distinct palindromic primes in two ways: 282 = 101 + 181 = 131 + 151. Thus, 282 is in this sequence.

MATHEMATICA

q := Select[Range[50000], PalindromeQ[#] && PrimeQ[#] &]

Sort[Transpose[Select[Tally[Flatten[Table[q[[n]] + q[[m]], {n, Length[q]}, {m, n + 1, Length[q]}]]], PalindromeQ[#[[1]]] && #[[2]] > 1 &]][[1]]]

PROG

(Python)

from sympy import isprime

from itertools import product

def ispal(n): s = str(n); return s == s[::-1]

def oddpals(d): # generator of odd palindromes with d digits

if d == 1: yield from [1, 3, 5, 7, 9]; return

for first in "13579":

for p in product("0123456789", repeat=(d-2)//2):

left = "".join(p); right = left[::-1]

for mid in [[""], "0123456789"][d%2]:

yield int(first + left + mid + right + first)

def auptod(dd):

N, alst, pp, once, twice = 10**dd, [], [2, 3, 5, 7, 11], set(), set()

pp += [p for d in range(3, dd+1, 2) for p in oddpals(d) if isprime(p)]

sums = (p+q for p in pp for q in pp if p<q and p+q<N and ispal(p+q))

for s in sums:

if s in once: twice.add(s)

else: once.add(s)

return sorted(twice)

print(auptod(5)) # Michael S. Branicky, Aug 31 2022

CROSSREFS

KEYWORD

nonn,base

AUTHOR

Tanya Khovanova and Massimo Kofler, Aug 31 2022

STATUS

approved