login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Palindromes in A082939.
3

%I #31 Aug 15 2022 15:30:43

%S 1,2,22,141,171,202,333,2002,2772,7227,10401,10701,12221,13131,14841,

%T 15651,16461,17271,20002,21212,25452,26262,27072,30303,31113,33633,

%U 35253,41814,51615,52425,53235,55755,58185,61416,62226,66366,69696,71217,72027,85158,96669,117711

%N Palindromes in A082939.

%H Michael S. Branicky, <a href="/A082940/b082940.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..670 from J.W.L. (Jan) Eerland)

%e 22 = 2!*2! = 4 and 2 + 2 = 4.

%e 141 = 1!*4!*1! = 24; 2 + 4 = 6 and 1 + 4 + 1 = 6.

%t DeleteCases[ParallelTable[If[PalindromeQ[n]&&Total@IntegerDigits[Times@@Map[Factorial,IntegerDigits[n]]]==Total@IntegerDigits[n],n,a],{n,0,10^8}],a] (* _J.W.L. (Jan) Eerland_, Dec 26 2021 *)

%o (Python)

%o from math import factorial, prod

%o from itertools import count, islice, product

%o def isA082939(n):

%o d = list(map(int, str(n)))

%o return sum(map(int, str(prod(map(factorial, d))))) == sum(d)

%o def pals(): # generator of terms

%o digits = "0123456789"

%o for d in count(1):

%o for p in product(digits, repeat=d//2):

%o if d > 1 and p[0] == "0": continue

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

%o for mid in [[""], digits][d%2]:

%o yield int(left + mid + right)

%o def agen(): yield from filter(isA082939, pals())

%o print(list(islice(agen(), 42))) # _Michael S. Branicky_, Aug 15 2022

%Y Intersection of A002113 and A082939.

%K nonn,base

%O 1,2

%A Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 27 2003, following a suggestion by _Amarnath Murthy_.

%E Corrected and extended by _J.W.L. (Jan) Eerland_, Dec 26 2021