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.

A046807 Palindromes in factorial base.

Original entry on oeis.org

0, 1, 3, 7, 9, 11, 25, 33, 41, 121, 127, 133, 139, 147, 153, 159, 165, 173, 179, 185, 191, 721, 751, 781, 811, 843, 873, 903, 933, 965, 995, 1025, 1055, 5041, 5065, 5089, 5113, 5137, 5167, 5191, 5215, 5239, 5263, 5293, 5317, 5341, 5365, 5389, 5419, 5443, 5467
Offset: 1

Views

Author

Keywords

Comments

Equivalently numbers n such that row n of A108731 is symmetric. - Rémy Sigrist, Mar 20 2018

Examples

			41 = 1 4! + 2 3! + 2 2! + 1 1!.
		

Crossrefs

Cf. A108731.

Programs

  • PARI
    is(n) = my (d=[]); for (r=2, oo, if (n==0, return (Vecrev(d)==d), d=concat(n%r, d); n\=r)) \\ Rémy Sigrist, Mar 19 2018
    
  • Python
    from math import factorial
    from itertools import count, islice, product
    def palgen(): # generator of palindromic representations in the factorial base
        yield from [(0,), (1,)]
        for d in count(2):
            pp = []
            for i in range(2, (d+1)//2+1):
                pp.append(range(0, i+1))
            for t in product(*pp):
                right = t
                left = right[:-1][::-1] if d&1 else right[::-1]
                yield (1, ) + right + left + (1, )
    def A046807_gen(): # generator of terms
        yield from (sum(dj*factorial(j) for j, dj in enumerate(t[::-1], 1)) for t in palgen())
    print(list(islice(A046807_gen(), 51))) # Michael S. Branicky, Mar 09 2025

Extensions

More terms from Floor van Lamoen, Oct 31 2001
Data corrected and initial 0 added by Rémy Sigrist, Mar 19 2018