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.

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).