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.

A084979 Palindromes such that the product of the digits + 1 is prime.

Original entry on oeis.org

1, 2, 4, 6, 11, 22, 44, 66, 111, 121, 141, 161, 212, 232, 242, 272, 292, 323, 343, 383, 414, 464, 474, 545, 565, 616, 626, 636, 656, 747, 838, 848, 878, 898, 929, 969, 1111, 1221, 1441, 1661, 2112, 2222, 2332, 2552, 2772, 2882, 3223, 3883, 4114, 4444, 4554
Offset: 1

Views

Author

Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 21 2003

Keywords

Examples

			383 is a term since 3*8*3 = 72, 72+1 = 73 is prime.
		

Crossrefs

Cf. A081988.

Programs

  • Mathematica
    Select[ Range[4663], FromDigits[ Reverse[ IntegerDigits[ # ]]] == # && PrimeQ[1 + Times @@ IntegerDigits[ # ]] & ]
    Parallelize[While[True,If[PalindromeQ[n]&&PrimeQ[1+Product[Part[IntegerDigits[n],k],{k,1,Length[IntegerDigits[n]]}]],Print[n]];n++];n] (* J.W.L. (Jan) Eerland, Dec 27 2021 *)
  • Python
    from math import prod
    from sympy import isprime
    from itertools import count, islice, product
    def cond(n): return isprime(prod(map(int, str(n))) + 1)
    def pals(): # generator of palindromes as strings
        digits = "0123456789"
        for d in count(1):
            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 agen(): yield from filter(cond, pals())
    print(list(islice(agen(), 51))) # Michael S. Branicky, Aug 22 2022

Formula

a(n) >> n^k, where k = log_3(10) = 2.0959.... - Charles R Greathouse IV, Aug 02 2010

Extensions

Edited, corrected and extended by Robert G. Wilson v, Jun 21 2003
Formula by Charles R Greathouse IV, Aug 02 2010