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.

Previous Showing 11-14 of 14 results.

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

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

Original entry on oeis.org

0, 1, 2, 10, 11, 19, 27, 54, 55, 63, 71, 98, 106, 133, 160, 224, 225, 233, 241, 268, 276, 303, 330, 394, 402, 429, 456, 520, 547, 611, 675, 800, 801, 809, 817, 844, 852, 879, 906, 970, 978, 1005, 1032, 1096, 1123, 1187, 1251, 1376, 1384, 1411, 1438, 1502, 1529, 1593, 1657, 1782, 1809, 1873, 1937, 2062, 2126, 2251
Offset: 0

Views

Author

N. J. A. Sloane, Nov 12 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate @ (Table[DigitCount[n, 2, 1], {n, 0, 60}]^3) (* Amiram Eldar, Jan 20 2022 *)
  • PARI
    a(n) = sum(i=0, n, hammingweight(i)^3); \\ Michel Marcus, Sep 20 2017

Formula

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

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

Original entry on oeis.org

0, 1, 2, 18, 19, 35, 51, 132, 133, 149, 165, 246, 262, 343, 424, 680, 681, 697, 713, 794, 810, 891, 972, 1228, 1244, 1325, 1406, 1662, 1743, 1999, 2255, 2880, 2881, 2897, 2913, 2994, 3010, 3091, 3172, 3428, 3444, 3525, 3606, 3862, 3943, 4199, 4455, 5080, 5096, 5177, 5258, 5514, 5595, 5851, 6107, 6732, 6813, 7069
Offset: 0

Views

Author

N. J. A. Sloane, Nov 12 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate @ (Table[DigitCount[n, 2, 1], {n, 0, 60}]^4) (* Amiram Eldar, Jan 20 2022 *)
  • PARI
    a(n) = sum(i=0, n, hammingweight(i)^4); \\ Michel Marcus, Nov 12 2013

Formula

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

A361257 a(n) = Sum_{j=0..n} n^wt(j), where wt = A000120.

Original entry on oeis.org

1, 2, 5, 16, 29, 66, 127, 512, 737, 1090, 1541, 3312, 4369, 7658, 12209, 65536, 83537, 105282, 130987, 167600, 203701, 254122, 313259, 649728, 766201, 912626, 1079027, 1778896, 2071469, 3081570, 4329151, 33554432, 39135425, 45436546, 52524221, 60511536
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2023

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<0, 0,
          b(n-1)+x^add(i, i=Bits[Split](n)))
        end:
    a:= n-> subs(x=n, b(n)):
    seq(a(n), n=0..37);
  • Python
    def A361257(n): return sum([n**j.bit_count() for j in range(0,n+1)])
    print(list(A361257(n) for n in range(0,37))) # Dumitru Damian, Mar 06 2023
    
  • Python
    from collections import Counter
    def A361257(n): return sum(j*n**i for i, j in Counter(j.bit_count() for j in range(n+1)).items()) # Chai Wah Wu, Mar 06 2023

Formula

a(n) = Sum_{j=0..n} n^wt(j), where wt = A000120.
a(n) = Sum_{k>=0} n^k * A360189(n,k).
a(n) mod 2 = A059841(n).
a(2^n-1) = 2^(n^2) = A002416(n).
Previous Showing 11-14 of 14 results.