OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
FORMULA
MATHEMATICA
Select[Range[20125], !PrimeQ[#] && Reverse[x=IntegerDigits[#]] == x && PrimeQ[Total[Times@@@FactorInteger[#]]]&] (* Jayanta Basu, May 29 2013 *)
PROG
(Python)
from itertools import product
from sympy import factorint, isprime
def pals(d, base=10): # all d-digit palindromes
digits = "".join(str(i) for i in range(base))
for p in product(digits, repeat=d//2):
if d > 1 and p[0] == "0": continue
left = "".join(p); right = left[::-1]
for mid in [[""], digits][d%2]: yield int(left + mid + right)
def ok(pal):
f = factorint(pal); return len(f)>1 and isprime(sum(p*f[p] for p in f))
print(list(filter(ok, (p for d in range(1, 6) for p in pals(d) if ok(p))))) # Michael S. Branicky, Jun 22 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jun 15 1998
EXTENSIONS
a(45) and beyond from Michael S. Branicky, Jun 22 2021
STATUS
approved