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.

Showing 1-1 of 1 results.

A082940 Palindromes in A082939.

Original entry on oeis.org

1, 2, 22, 141, 171, 202, 333, 2002, 2772, 7227, 10401, 10701, 12221, 13131, 14841, 15651, 16461, 17271, 20002, 21212, 25452, 26262, 27072, 30303, 31113, 33633, 35253, 41814, 51615, 52425, 53235, 55755, 58185, 61416, 62226, 66366, 69696, 71217, 72027, 85158, 96669, 117711
Offset: 1

Views

Author

Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 27 2003, following a suggestion by Amarnath Murthy

Keywords

Examples

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

Crossrefs

Intersection of A002113 and A082939.

Programs

  • Mathematica
    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 *)
  • Python
    from math import factorial, prod
    from itertools import count, islice, product
    def isA082939(n):
        d = list(map(int, str(n)))
        return sum(map(int, str(prod(map(factorial, d))))) == sum(d)
    def pals(): # generator of terms
        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(isA082939, pals())
    print(list(islice(agen(), 42))) # Michael S. Branicky, Aug 15 2022

Extensions

Corrected and extended by J.W.L. (Jan) Eerland, Dec 26 2021
Showing 1-1 of 1 results.