A046807 Palindromes in factorial base.
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
Examples
41 = 1 4! + 2 3! + 2 2! + 1 1!.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms n = 1..1000 from _Rémy Sigrist_)
- Index entries for sequences related to factorial base representation
- Index entries for sequences related to palindromes
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
Comments