%I #33 Mar 06 2023 18:11:49
%S 0,1,2,6,7,11,15,24,25,29,33,42,46,55,64,80,81,85,89,98,102,111,120,
%T 136,140,149,158,174,183,199,215,240,241,245,249,258,262,271,280,296,
%U 300,309,318,334,343,359,375,400,404,413,422,438,447,463,479,504,513,529,545,570,586,611,636,672,673,677,681,690,694
%N a(n) = Sum_{i=0..n} wt(i)^2, where wt(i) = A000120(i).
%C Stolarsky (1977) has an extensive bibliography.
%H Amiram Eldar, <a href="/A231500/b231500.txt">Table of n, a(n) for n = 0..10000</a> (terms 0..1024 from Ivan Neretin)
%H Jean Coquet, <a href="https://doi.org/10.1016/0022-314X(86)90067-3">Power sums of digital sums</a>, J. Number Theory, Vol. 22, No. 2 (1986), pp. 161-176.
%H P. J. Grabner, P. Kirschenhofer, H. Prodinger and R. F. Tichy, <a href="http://math.sun.ac.za/~hproding/abstract/abs_80.htm">On the moments of the sum-of-digits function</a>, <a href="http://math.sun.ac.za/~hproding/pdffiles/st_andrews.pdf">PDF</a>, Applications of Fibonacci numbers, Vol. 5 (St. Andrews, 1992), Kluwer Acad. Publ., Dordrecht, 1993, pp. 263-271; <a href="https://math.sun.ac.za/prodinger/pdffiles/st_andrews.pdf">alternative link</a>.
%H J.-L. Mauclaire and Leo Murata, <a href="https://dx.doi.org/10.3792/pjaa.59.274">On q-additive functions. I</a>, Proc. Japan Acad. Ser. A Math. Sci., Vol. 59, No. 6 (1983), pp. 274-276.
%H J.-L. Mauclaire and Leo Murata, <a href="https://dx.doi.org/10.3792/pjaa.59.441">On q-additive functions. II</a>, Proc. Japan Acad. Ser. A Math. Sci., Vol. 59, No. 9 (1983), pp. 441-444.
%H Kenneth B. Stolarsky, <a href="http://dx.doi.org/10.1137/0132060">Power and exponential sums of digital sums related to binomial coefficient parity</a>, SIAM J. Appl. Math., Vol. 32, No. 4 (1977), pp. 717-730.
%H J. R. Trollope, <a href="http://www.jstor.org/stable/2687954">An explicit expression for binary digital sums</a>, Math. Mag., Vol. 41, No. 1 (1968), pp. 21-25.
%F Stolarsky (1977) studies the asymptotics.
%F a(n) ~ n * (log(n)/(2*log(2)))^2 + O(n*log(n)) (Stolarsky, 1977). - _Amiram Eldar_, Jan 20 2022
%F a(n) = Sum_{k=0..floor(log_2(n+1))} k^2 * A360189(n,k). - _Alois P. Heinz_, Mar 06 2023
%p digsum:=proc(n,B) local a; a := convert(n, base, B):
%p add(a[i], i=1..nops(a)): end;
%p f:=proc(n,k,B) global digsum; local i;
%p add( digsum(i,B)^k,i=0..n); end;
%p [seq(f(n,1,2),n=0..100)]; #A000788
%p [seq(f(n,2,2),n=0..100)]; #A231500
%p [seq(f(n,3,2),n=0..100)]; #A231501
%p [seq(f(n,4,2),n=0..100)]; #A231502
%t FoldList[#1 + DigitCount[#2, 2, 1]^2 &, 0, Range[1, 68]] (* _Ivan Neretin_, May 21 2015 *)
%o (PARI) a(n) = sum(i=0, n, hammingweight(i)^2); \\ _Michel Marcus_, Sep 20 2017
%Y Cf. A000120, A000788, A231501, A231502, A360189.
%K nonn,base
%O 0,3
%A _N. J. A. Sloane_, Nov 12 2013
|