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.

A231500 a(n) = Sum_{i=0..n} wt(i)^2, where wt(i) = A000120(i).

Original entry on oeis.org

0, 1, 2, 6, 7, 11, 15, 24, 25, 29, 33, 42, 46, 55, 64, 80, 81, 85, 89, 98, 102, 111, 120, 136, 140, 149, 158, 174, 183, 199, 215, 240, 241, 245, 249, 258, 262, 271, 280, 296, 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
Offset: 0

Views

Author

N. J. A. Sloane, Nov 12 2013

Keywords

Comments

Stolarsky (1977) has an extensive bibliography.

Crossrefs

Programs

  • Maple
    digsum:=proc(n,B) local a; a := convert(n, base, B):
    add(a[i], i=1..nops(a)): end;
    f:=proc(n,k,B) global digsum; local i;
    add( digsum(i,B)^k,i=0..n); end;
    [seq(f(n,1,2),n=0..100)]; #A000788
    [seq(f(n,2,2),n=0..100)]; #A231500
    [seq(f(n,3,2),n=0..100)]; #A231501
    [seq(f(n,4,2),n=0..100)]; #A231502
  • Mathematica
    FoldList[#1 + DigitCount[#2, 2, 1]^2 &, 0, Range[1, 68]] (* Ivan Neretin, May 21 2015 *)
  • PARI
    a(n) = sum(i=0, n, hammingweight(i)^2); \\ Michel Marcus, Sep 20 2017

Formula

Stolarsky (1977) studies the asymptotics.
a(n) ~ n * (log(n)/(2*log(2)))^2 + O(n*log(n)) (Stolarsky, 1977). - Amiram Eldar, Jan 20 2022
a(n) = Sum_{k=0..floor(log_2(n+1))} k^2 * A360189(n,k). - Alois P. Heinz, Mar 06 2023