cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A046365 Composite palindromes whose sum of prime factors is prime (counted with multiplicity).

Original entry on oeis.org

6, 22, 88, 99, 202, 252, 333, 414, 424, 454, 464, 595, 686, 747, 777, 808, 838, 848, 858, 909, 1001, 1551, 1771, 2442, 3553, 4114, 5335, 5775, 6336, 6996, 8008, 8228, 9009, 9559, 9669, 9889, 12121, 14241, 16261, 16761, 17171, 18081, 18381, 20102, 20602, 21012
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[20125], !PrimeQ[#] && Reverse[x=IntegerDigits[#]] == x && PrimeQ[Total[Times@@@FactorInteger[#]]]&] (* Jayanta Basu, May 29 2013 *)
  • 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

Formula

A046363 INTERSECT A002113. - R. J. Mathar, Sep 09 2015

Extensions

a(45) and beyond from Michael S. Branicky, Jun 22 2021