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.
%I A046807 #21 Mar 10 2025 11:11:32 %S A046807 0,1,3,7,9,11,25,33,41,121,127,133,139,147,153,159,165,173,179,185, %T A046807 191,721,751,781,811,843,873,903,933,965,995,1025,1055,5041,5065,5089, %U A046807 5113,5137,5167,5191,5215,5239,5263,5293,5317,5341,5365,5389,5419,5443,5467 %N A046807 Palindromes in factorial base. %C A046807 Equivalently numbers n such that row n of A108731 is symmetric. - _Rémy Sigrist_, Mar 20 2018 %H A046807 Michael S. Branicky, <a href="/A046807/b046807.txt">Table of n, a(n) for n = 1..10000</a> (terms n = 1..1000 from _Rémy Sigrist_) %H A046807 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a> %H A046807 <a href="/index/Pac#palindromes">Index entries for sequences related to palindromes</a> %e A046807 41 = 1 4! + 2 3! + 2 2! + 1 1!. %o A046807 (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 %o A046807 (Python) %o A046807 from math import factorial %o A046807 from itertools import count, islice, product %o A046807 def palgen(): # generator of palindromic representations in the factorial base %o A046807 yield from [(0,), (1,)] %o A046807 for d in count(2): %o A046807 pp = [] %o A046807 for i in range(2, (d+1)//2+1): %o A046807 pp.append(range(0, i+1)) %o A046807 for t in product(*pp): %o A046807 right = t %o A046807 left = right[:-1][::-1] if d&1 else right[::-1] %o A046807 yield (1, ) + right + left + (1, ) %o A046807 def A046807_gen(): # generator of terms %o A046807 yield from (sum(dj*factorial(j) for j, dj in enumerate(t[::-1], 1)) for t in palgen()) %o A046807 print(list(islice(A046807_gen(), 51))) # _Michael S. Branicky_, Mar 09 2025 %Y A046807 Cf. A108731. %K A046807 base,nonn %O A046807 1,3 %A A046807 _Erich Friedman_ %E A046807 More terms from _Floor van Lamoen_, Oct 31 2001 %E A046807 Data corrected and initial 0 added by _Rémy Sigrist_, Mar 19 2018