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.

This page as a plain text file.
%I A084979 #19 Aug 22 2022 19:25:26
%S A084979 1,2,4,6,11,22,44,66,111,121,141,161,212,232,242,272,292,323,343,383,
%T A084979 414,464,474,545,565,616,626,636,656,747,838,848,878,898,929,969,1111,
%U A084979 1221,1441,1661,2112,2222,2332,2552,2772,2882,3223,3883,4114,4444,4554
%N A084979 Palindromes such that the product of the digits + 1 is prime.
%H A084979 J.W.L. (Jan) Eerland, <a href="/A084979/b084979.txt">Table of n, a(n) for n = 1..10928</a>
%F A084979 a(n) >> n^k, where k = log_3(10) = 2.0959.... - _Charles R Greathouse IV_, Aug 02 2010
%e A084979 383 is a term since 3*8*3 = 72, 72+1 = 73 is prime.
%t A084979 Select[ Range[4663], FromDigits[ Reverse[ IntegerDigits[ # ]]] == # && PrimeQ[1 + Times @@ IntegerDigits[ # ]] & ]
%t A084979 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 *)
%o A084979 (Python)
%o A084979 from math import prod
%o A084979 from sympy import isprime
%o A084979 from itertools import count, islice, product
%o A084979 def cond(n): return isprime(prod(map(int, str(n))) + 1)
%o A084979 def pals(): # generator of palindromes as strings
%o A084979     digits = "0123456789"
%o A084979     for d in count(1):
%o A084979         for p in product(digits, repeat=d//2):
%o A084979             if d > 1 and p[0] == "0": continue
%o A084979             left = "".join(p); right = left[::-1]
%o A084979             for mid in [[""], digits][d%2]:
%o A084979                 yield int(left + mid + right)
%o A084979 def agen(): yield from filter(cond, pals())
%o A084979 print(list(islice(agen(), 51))) # _Michael S. Branicky_, Aug 22 2022
%Y A084979 Cf. A081988.
%K A084979 nonn,base
%O A084979 1,2
%A A084979 Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 21 2003
%E A084979 Edited, corrected and extended by _Robert G. Wilson v_, Jun 21 2003
%E A084979 Formula by _Charles R Greathouse IV_, Aug 02 2010