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

This page as a plain text file.
%I A368342 #23 Mar 11 2024 08:29:11
%S A368342 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,
%T A368342 73,75,77,80,83,87,89,92,95,99,103,108,111,115,119,124,129,135,139,
%U A368342 144,149,155,161,168,170,173,176,180,184,189,192,196,200,205,210,216
%N A368342 Sum of digits of the numbers 0..n-1 in factorial base (A108731).
%C A368342 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.
%H A368342 Kevin Ryde, <a href="/A368342/b368342.txt">Table of n, a(n) for n = 0..10000</a>
%H A368342 Kevin Ryde, <a href="/A368342/a368342.gp.txt">PARI/GP Code</a>.
%H A368342 J. R. Trollope, <a href="https://www.jstor.org/stable/2314259">Generalized Bases and Digital Sums</a>, American Mathematical Monthly, volume 74, number 6, July 1967, pp. 690-694.
%H A368342 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>.
%F A368342 a(n) = Sum_{i=0..n-1} A034968(i).
%F A368342 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].
%F A368342 a(n) ~ (1/4)*n*k^2 where k = A084558(n), from the j=k term in the above sum.
%F A368342 a(n) = a(n-k!) + n-k! + k!*k*(k-1)/4, for k! <= n < (k+1)!, which is k = A084558(n).
%F A368342 a(k!) = k! * k*(k-1)/4 = A001809(k).
%e A368342 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.
%t A368342 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 *)
%o A368342 (PARI) \\ See links.
%Y A368342 Cf. A007623, A108731 (factorial base), A301652 (reversed), A084558 (length), A034968 (digit sum).
%Y A368342 Cf. A001809.
%K A368342 nonn,base,easy
%O A368342 0,4
%A A368342 _Kevin Ryde_, Dec 30 2023