A368342 Sum of digits of the numbers 0..n-1 in factorial base (A108731).
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.
Links
- Kevin Ryde, Table of n, a(n) for n = 0..10000
- Kevin Ryde, PARI/GP Code.
- J. R. Trollope, Generalized Bases and Digital Sums, American Mathematical Monthly, volume 74, number 6, July 1967, pp. 690-694.
- Index entries for sequences related to factorial base representation.
Crossrefs
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.
Comments