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-10 of 44 results. Next

A368342 Sum of digits of the numbers 0..n-1 in factorial base (A108731).

Original entry on oeis.org

0, 0, 1, 2, 4, 6, 9, 10, 12, 14, 17, 20, 24, 26, 29, 32, 36, 40, 45, 48, 52, 56, 61, 66, 72, 73, 75, 77, 80, 83, 87, 89, 92, 95, 99, 103, 108, 111, 115, 119, 124, 129, 135, 139, 144, 149, 155, 161, 168, 170, 173, 176, 180, 184, 189, 192, 196, 200, 205, 210, 216
Offset: 0

Views

Author

Kevin Ryde, Dec 30 2023

Keywords

Comments

Trollope considers sums of digits in a mixed-radix representation and the present sequence is a(n) = Trollope's A(n) for the case xi_i = i+1.

Examples

			For n=8, the factorial-base representations of 0..7 are 0, 1, 10, 11, 20, 21, 100, 101 and their total sum of digits is a(8) = 12.
		

Crossrefs

Cf. A007623, A108731 (factorial base), A301652 (reversed), A084558 (length), A034968 (digit sum).
Cf. A001809.

Programs

  • Mathematica
    s[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, AppendTo[s, r]; m++]; Total[s]]; Join[{0}, Accumulate[Array[s, 100, 0]]] (* Amiram Eldar, Mar 11 2024 *)
  • PARI
    \\ See links.

Formula

a(n) = Sum_{i=0..n-1} A034968(i).
a(n) = Sum_{j=1..k} d[j] * (s(j) + d[j]/2 + (j-2)*(j+1)/4) * j!, where d[j] = A301652(n,j) are the factorial-base digits n = Sum_{j=1..k} d[j]*j!, where k = A084558(n), and digit sum s(j) = Sum_{i=j+1..k} d[i].
a(n) ~ (1/4)*n*k^2 where k = A084558(n), from the j=k term in the above sum.
a(n) = a(n-k!) + n-k! + k!*k*(k-1)/4, for k! <= n < (k+1)!, which is k = A084558(n).
a(k!) = k! * k*(k-1)/4 = A001809(k).

A007623 Integers written in factorial base.

Original entry on oeis.org

0, 1, 10, 11, 20, 21, 100, 101, 110, 111, 120, 121, 200, 201, 210, 211, 220, 221, 300, 301, 310, 311, 320, 321, 1000, 1001, 1010, 1011, 1020, 1021, 1100, 1101, 1110, 1111, 1120, 1121, 1200, 1201, 1210, 1211, 1220, 1221, 1300, 1301, 1310, 1311, 1320, 1321, 2000, 2001, 2010
Offset: 0

Views

Author

Keywords

Comments

Places reading from right have values (1, 2, 6, 24, 120, ...) = factorials.
Also the reversed inversion vectors for the list of all finite permutations in reversed lexicographic order: A055089.
This concatenated representation is unsatisfactory for large n (above 36287999), when coefficients of 10 or greater start to appear. For these large numbers the representation given in A108731 is better. - N. J. A. Sloane, Jun 04 2012
For n < 10*10!-1, a(n) = concatenation of n-th row of triangle in A108731. - Reinhard Zumkeller, Jun 04 2012
a(n) = A049345(n) for n=0..23. - Reinhard Zumkeller, Jan 05 2014
For n = 36288000 = 10 * 10!, the digits in factorial base are {10, 0, 0, 0, 0, 0, 0, 0, 0, 0}. - Michael De Vlieger, Oct 11 2015, corrected and edited by M. F. Hasler, Nov 27 2018
The alt text in xkcd comic #2835 describes "Numbers larger than about 3.6 million" to be illegal. See links. - David Cleaver, Sep 30 2023

Examples

			a(47) = 1321 because 47 = 1*4! + 3*3! + 2*2! + 1*1!
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 2, p. 192.
  • F. Smarandache, Definitions solved and unsolved problems, conjectures and theorems in number theory and geometry, edited by M. Perez, Xiquan Publishing House, 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000142, A034968 (sum of digits), A060130 (number of nonzero digits), A099563 (the most significant digit).
Cf. also A055089, A055881, A060112, A060495. Permutation of A064039.
See index entry "factorial base representation" for many more related sequences.
See also primorial base A049345.

Programs

  • Haskell
    a007623 n | n <= 36287999 = read $ concatMap show (a108731_row n) :: Int
              | otherwise     = error "representation would be ambiguous"
    -- Reinhard Zumkeller, Jun 04 2012
    (Scheme, R6RS standard) (define (A007623 n) (let loop ((n n) (s 0) (p 1) (i 2)) (if (zero? n) s (let ((d (mod n i))) (loop (/ (- n d) i) (+ (* p d) s) (* 10 p) (+ 1 i)))))) ;; In older Schemes use modulo instead of mod. - Antti Karttunen, Feb 13 2016
    
  • Maple
    a := n -> if nargs<2 then a(n,2) elif n
    				
  • Mathematica
    factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++ ]; m = n; len = i; dList = Table[0, {len}]; Do[ currDigit = 0; While[m >= j!, m = m - j!; currDigit++ ]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; Table[FromDigits[factBaseIntDs[n]], {n, 0, 50}] (* Alonso del Arte, May 03 2006 *)
    lim = 50; m = 1; While[Factorial@ m < lim, m++]; m; IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] & /@ Range@ lim (* Michael De Vlieger, Oct 11 2015, Version 10.2 *)
  • PARI
    apply( a(n,p=2)=if(nM. F. Hasler, Mar 27 2007; minor edit Nov 26 2018
    
  • Python
    def a(n, p=2): return n if n

Extensions

More terms from R. K. Guy

A084558 a(0) = 0; for n >= 1: a(n) = largest m such that n >= m!.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Jun 23 2003

Keywords

Comments

For n >= 1, a(n) = the number of significant digits in n's factorial base representation (A007623).
After zero, which occurs once, each n occurs A001563(n) times.
Number of iterations (...(f_4(f_3(f_2(n))))...) such that the result is < 1, where f_j(x):=x/j. - Hieronymus Fischer, Apr 30 2012
For n > 0: a(n) = length of row n in table A108731. - Reinhard Zumkeller, Jan 05 2014

Examples

			a(4) = 2 because 2! <= 4 < 3!.
		

References

  • F. Smarandache, "f-Inferior and f-Superior Functions - Generalization of Floor Functions", Arizona State University, Special Collections.

Crossrefs

Programs

  • Haskell
    a084558 n = a090529 (n + 1) - 1  -- Reinhard Zumkeller, Jan 05 2014
    
  • Maple
    0, seq(m$(m*m!),m=1..5); # Robert Israel, Apr 27 2015
  • Mathematica
    Table[m = 1; While[m! <= n, m++]; m - 1, {n, 0, 104}] (* Jayanta Basu, May 24 2013 *)
    Table[Floor[Last[Reduce[x! == n && x > 0, x]]], {n, 120}] (* Eric W. Weisstein, Sep 13 2024 *)
  • PARI
    a(n)={my(m=0);while(n\=m++,);m-1} \\ R. J. Cano, Apr 09 2018
    
  • Python
    def A084558(n):
      i=1
      while n: i+=1; n//=i
      return(i-1)
    print(list(map(A084558,range(101)))) # Natalia L. Skirrow, May 28 2023

Formula

From Hieronymus Fischer, Apr 30 2012: (Start)
a(n!) = a((n-1)!)+1, for n>1.
G.f.: 1/(1-x)*Sum_{k>=1} x^(k!).
The explicit first terms of the g.f. are: (x+x^2+x^6+x^24+x^120+x^720...)/(1-x).
(End)
Other identities:
For all n >= 0, a(n) = A090529(n+1) - 1. - Reinhard Zumkeller, Jan 05 2014
For all n >= 1, a(n) = A060130(n) + A257510(n). - Antti Karttunen, Apr 27 2015
a(n) ~ log(n^2/(2*Pi)) / (2*LambertW(log(n^2/(2*Pi))/(2*exp(1)))) - 1/2. - Vaclav Kotesovec, Aug 22 2025

Extensions

Name clarified by Antti Karttunen, Apr 27 2015

A325617 Multinomial coefficient of the prime signature of n!.

Original entry on oeis.org

1, 1, 1, 2, 4, 20, 105, 840, 3960, 51480, 675675, 10810800, 139675536, 2793510720, 58663725120, 1799020903680, 26985313555200, 782574093100800, 25992639520848000, 857757104187984000, 30021498646579440000, 1563341744336692320000, 64179292662243158400000
Offset: 0

Views

Author

Gus Wiseman, May 12 2019

Keywords

Comments

Number of permutations of the multiset of prime factors of n!.

Examples

			The a(5) = 20 permutations of {2,2,2,3,5}:
  (22235)  (32225)  (52223)
  (22253)  (32252)  (52232)
  (22325)  (32522)  (52322)
  (22352)  (35222)  (53222)
  (22523)
  (22532)
  (23225)
  (23252)
  (23522)
  (25223)
  (25232)
  (25322)
		

Crossrefs

Programs

  • Mathematica
    Table[Multinomial@@Last/@FactorInteger[n!],{n,0,15}]

Formula

a(n) = A318762(A181819(n!)).

A235168 Triangle read by rows: row n gives digits of n in primorial base.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 2, 0, 2, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 2, 0, 1, 2, 1, 2, 0, 0, 2, 0, 1, 2, 1, 0, 2, 1, 1, 2, 2, 0, 2, 2, 1, 3, 0, 0, 3, 0, 1, 3, 1, 0, 3, 1, 1, 3, 2, 0, 3, 2, 1, 4, 0, 0, 4, 0, 1, 4, 1, 0, 4, 1, 1, 4, 2, 0, 4, 2, 1, 1, 0, 0, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 05 2014

Keywords

Comments

T(n,k) = A108731(n,k) for k=0..23.
a(n) = A108731(n) for n=0..63, when both tables are seen as flattened lists.
T(n,k) < 10 for k = 1..A235224(n) and n < 2100 = 10 * 7#.
When read from right to left, the row n gives exponents for successive primes 2, 3, 5, 7, 11, etc., in A276086(n). - Antti Karttunen, Mar 15 2021

Examples

			.        n | .. + _*7# + _*5# + _*3# + _*2# + _*1# | row(n)
. ---------+---------------------------------------+---------------------
.       10 | 1*6 + 2*2 + 0*1                       | [1,2,0], A276086(10) = 5 * 3^2
.      100 | 3*30 + 1*6 + 2*2 + 0*1                | [3,1,2,0]
.     1000 | 4*210 + 5*30 + 1*6 + 2*2n + 0*1       | [4,5,1,2,0]
.     2099 | 9*210 + 6*30 + 4*6 + 2*2 + 1*1        | [9,6,4,2,1]
.     2100 | 10*210 + 0*30 + 0*6 + 0*2 + 0*1       | [10,0,0,0,0]
.    10000 | 4*2310 + 3*210 + 4*30 + 1*6 + 2*2     | [4,3,4,1,2,0]
.   100000 | 3*30030+4*2310+3*210+1*30+1*6+2*2+0*1 | [3,4,3,1,1,2,0]
.  1000000 |                                       | [1,16,3,9,6,1,2,0]
. 10000000 |                                       | [1,0,10,0,0,0,1,2,0]
.  1000000 = 1*510510+16*30030+3*2310+9*210+6*30+1*6+2*2+0*1
. 10000000 = 1*9699690+0*510510+10*30030+0*2310+0*210+0*30+1*6+2*2+0*1
		

Crossrefs

Cf. A002110, A049345, A108731, A235224 (row lengths), A276086.

Programs

  • Haskell
    a235168 n k = a235168_row n !! k
    a235168_row 0 = [0]
    a235168_row n = t n $ reverse $ takeWhile (<= n) a002110_list
       where t 0 []     = []
             t x (b:bs) = x' : t m bs where (x', m) = divMod x b
    a235168_tabf = map a235168_row [0..]
  • Mathematica
    row[n_] := Module[{k = n, p = 2, s = {}, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, AppendTo[s, r]; p = NextPrime[p]]; Reverse[s]]; row[0] = {0}; Array[row, 31, 0] // Flatten (* Amiram Eldar, Mar 11 2024 *)

A336415 Number of divisors of n! with equal prime multiplicities.

Original entry on oeis.org

1, 1, 2, 4, 6, 10, 13, 21, 24, 28, 33, 49, 53, 85, 94, 100, 104, 168, 173, 301, 307, 317, 334, 590, 595, 603, 636, 642, 652, 1164, 1171, 2195, 2200, 2218, 2283, 2295, 2301, 4349, 4478, 4512, 4519, 8615, 8626, 16818, 16836, 16844, 17101, 33485, 33491, 33507, 33516, 33582
Offset: 0

Views

Author

Gus Wiseman, Jul 22 2020

Keywords

Comments

A number k has "equal prime multiplicities" (or is "uniform") iff its prime signature is constant, meaning that k is a power of a squarefree number.

Examples

			The a(n) uniform divisors of n for n = 1, 2, 6, 8, 30, 36 are the columns:
  1  2  6  8  30  36
     1  3  6  15  30
        2  4  10  16
        1  3   8  15
           2   6  10
           1   5   9
               4   8
               3   6
               2   5
               1   4
                   3
                   2
                   1
In 20!, the multiplicity of the third prime (5) is 4 but the multiplicity of the fourth prime (7) is 2. Hence there are 2^3 - 1 = 3 divisors with all exponents 3 (we subtract |{1}| = 1 from that count as 1 has no exponent 3). - _David A. Corneth_, Jul 27 2020
		

Crossrefs

The version for distinct prime multiplicities is A336414.
The version for nonprime perfect powers is A336416.
Uniform partitions are counted by A047966.
Uniform numbers are A072774, with nonprime terms A182853.
Numbers with distinct prime multiplicities are A130091.
Divisors with distinct prime multiplicities are counted by A181796.
Maximum divisor with distinct prime multiplicities is A327498.
Uniform divisors are counted by A327527.
Maximum uniform divisor is A336618.
1st differences are given by A048675.

Programs

  • Mathematica
    Table[Length[Select[Divisors[n!],SameQ@@Last/@FactorInteger[#]&]],{n,0,15}]
  • PARI
    a(n) = sumdiv(n!, d, my(ex=factor(d)[,2]); (#ex==0) || (vecmin(ex) == vecmax(ex))); \\ Michel Marcus, Jul 24 2020
    
  • PARI
    a(n) = {if(n<2, return(1)); my(f = primes(primepi(n)), res = 1, t = #f); f = vector(#f, i, val(n, f[i])); for(i = 1, f[1], while(f[t] < i, t--; ); res+=(1<David A. Corneth, Jul 27 2020

Formula

a(n) = A327527(n!).

Extensions

Terms a(31) and onwards from David A. Corneth, Jul 27 2020

A335407 Number of anti-run permutations of the prime indices of n!.

Original entry on oeis.org

1, 1, 1, 2, 0, 2, 3, 54, 0, 30, 105, 6090, 1512, 133056, 816480, 127209600, 0, 10090080, 562161600, 69864795000, 49989139200, 29593652088000, 382147120555200, 41810689605484800, 4359985823793600, 3025062801079038720, 49052072750637116160, 25835971971637227375360
Offset: 0

Views

Author

Gus Wiseman, Jul 01 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Conjecture: Only vanishes at n = 4 and n = 8.
a(16) = 0. Proof: 16! = 2^15 * m where bigomega(m) = A001222(m) = 13. We can't separate 15 1's with 13 other numbers. - David A. Corneth, Jul 04 2020

Examples

			The a(0) = 1 through a(6) = 3 anti-run permutations:
  ()  ()  (1)  (1,2)  .  (1,2,1,3,1)  (1,2,1,2,1,3,1)
               (2,1)     (1,3,1,2,1)  (1,2,1,3,1,2,1)
                                      (1,3,1,2,1,2,1)
		

Crossrefs

The version for Mersenne numbers is A335432.
Anti-run compositions are A003242.
Anti-run patterns are counted by A005649.
Permutations of prime indices are A008480.
Anti-runs are ranked by A333489.
Separable partitions are ranked by A335433.
Inseparable partitions are ranked by A335448.
Anti-run permutations of prime indices are A335452.
Strict permutations of prime indices are A335489.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[Permutations[primeMS[n!]],!MatchQ[#,{_,x_,x_,_}]&]],{n,0,10}]
  • PARI
    \\ See A335452 for count.
    a(n)={count(factor(n!)[,2])} \\ Andrew Howroyd, Feb 03 2021

Formula

a(n) = A335452(A000142(n)). - Andrew Howroyd, Feb 03 2021

Extensions

Terms a(14) and beyond from Andrew Howroyd, Feb 03 2021

A246359 Maximum digit in the factorial base expansion of n (A007623).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
Offset: 0

Views

Author

Antti Karttunen, Oct 20 2014

Keywords

Comments

Maximum entry in n-th row of A108731.

Examples

			Factorial base representation of 46 is "1320" as 46 = 1*4! + 3*3! + 2*2! + 0*1!, and the largest of these digits is 3, thus a(46) = 3.
		

Crossrefs

Programs

  • Mathematica
    nn = 96; m = 1; While[Factorial@ m < nn, m++]; m; Table[Max@ IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]], {n, 0, nn}] (* Version 10.2, or *)
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Range[# + 1] <= n &]; Most@ Rest[a][[All, 1]] /. {} -> {0}]; Table[Max@ f@ n, {n, 0, 96}] (* Michael De Vlieger, Aug 29 2016 *)
  • Python
    def a007623(n, p=2): return n if n

Formula

From Antti Karttunen, Aug 29 2016: (Start)
a(0) = 0; for n >= 1, a(n) = 1 + a(A257684(n)).
a(0) = 0; for n >= 1, a(n) = max(A099563(n), a(A257687(n))).
a(n) = A051903(A276076(n)).
(End)

A325616 Triangle read by rows where T(n,k) is the number of length-k integer partitions of n into factorial numbers.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 2, 2, 1
Offset: 0

Views

Author

Gus Wiseman, May 12 2019

Keywords

Examples

			Triangle begins:
  1
  0 1
  0 1 1
  0 0 1 1
  0 0 1 1 1
  0 0 0 1 1 1
  0 1 0 1 1 1 1
  0 0 1 0 1 1 1 1
  0 0 1 1 1 1 1 1 1
  0 0 0 1 1 1 1 1 1 1
  0 0 0 1 1 2 1 1 1 1 1
  0 0 0 0 1 1 2 1 1 1 1 1
  0 0 1 0 1 1 2 2 1 1 1 1 1
  0 0 0 1 0 1 1 2 2 1 1 1 1 1
  0 0 0 1 1 1 1 2 2 2 1 1 1 1 1
  0 0 0 0 1 1 1 1 2 2 2 1 1 1 1 1
  0 0 0 0 1 1 2 1 2 2 2 2 1 1 1 1 1
  0 0 0 0 0 1 1 2 1 2 2 2 2 1 1 1 1 1
  0 0 0 1 0 1 1 2 2 2 2 2 2 2 1 1 1 1 1
  0 0 0 0 1 0 1 1 2 2 2 2 2 2 2 1 1 1 1 1
  0 0 0 0 1 1 1 1 2 2 3 2 2 2 2 2 1 1 1 1 1
Row n = 12 counts the following partitions:
  (66)
  (6222)
  (62211)
  (222222) (621111)
  (2222211) (6111111)
  (22221111)
  (222111111)
  (2211111111)
  (21111111111)
  (111111111111)
		

Crossrefs

Row sums are A064986.
Cf. A008284.
Reciprocal factorial sum: A325618, A325619, A325620, A325622.

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1-y*x^(i!)),{i,1,n}],{x,0,n},{y,0,k}],{n,0,15},{k,0,n}]

Formula

T(n,k) is the coefficient of x^n * y^k in the expansion of Product_{i > 0} 1/(1 - y * x^(i!)).

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
Showing 1-10 of 44 results. Next