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.

A379152 The binary weights of the odd Catalan numbers.

Original entry on oeis.org

1, 1, 2, 6, 16, 25, 60, 127, 244, 494, 1010, 2015, 4076, 8086, 16281, 32818, 65518, 131059, 262348, 524448, 1047643, 2097675, 4194133, 8386693, 16776916, 33554390, 67114125, 134214652, 268452748
Offset: 0

Views

Author

Amiram Eldar, Dec 17 2024

Keywords

Crossrefs

Similar sequences: A011373, A079584, A082481, A379151, A379153.

Programs

  • Mathematica
    a[n_] := DigitCount[CatalanNumber[2^n-1], 2, 1]; Array[a, 23, 0]
  • PARI
    a(n) = my(m = -1 + 1 << n); hammingweight(binomial(2*m, m)/(m+1));
    
  • Python
    from itertools import count, islice
    def A379152_gen(): # generator of terms
        yield from [1,1]
        c, s = 1, 3
        for n in count(2):
            c = (c*((n<<2)-2))//(n+1)
            if n == s:
                yield c.bit_count()
                s = (s<<1)|1
    A379152_list = list(islice(A379152_gen(),10)) # Chai Wah Wu, Dec 17 2024

Formula

a(n) = A000120(A038003(n)) = A000120(A000108(2^n-1)).
a(n) = A379151(2^n-1).