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.

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