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.

Showing 1-3 of 3 results.

A379151 The binary weights of the Catalan numbers (A000108).

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 2, 6, 6, 9, 6, 8, 8, 12, 9, 16, 13, 17, 12, 17, 13, 18, 15, 25, 20, 17, 20, 24, 28, 25, 26, 25, 25, 32, 27, 34, 29, 32, 33, 29, 35, 29, 31, 36, 35, 44, 44, 49, 40, 46, 48, 44, 38, 50, 43, 44, 46, 47, 55, 50, 52, 58, 59, 60, 65, 68, 56, 62, 68
Offset: 0

Views

Author

Amiram Eldar, Dec 16 2024

Keywords

Examples

			a(10) = 6 because Catalan(10) = 16796 = 100000110011100_2, which has 6 one bits. - _Vincenzo Librandi_, Feb 05 2025
		

Crossrefs

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

Programs

  • Magma
    [&+Intseq(Catalan(n), 2): n in [0..100]]; // Vincenzo Librandi, Feb 05 2025
  • Mathematica
    a[n_] := DigitCount[CatalanNumber[n], 2, 1]; Array[a, 100, 0]
  • PARI
    a(n) = hammingweight(binomial(2*n, n)/(n+1));
    

Formula

a(n) = A000120(A000108(n)).
Two formulas from Luca and Shparlinski (2011):
a(n) >= 3 for all but finitely many positive integers n.
a(n) >> eps(n) * sqrt(log(n)), for all n <= X with at most o(X) exceptions as X -> oo, where eps(n) is a function tending to zero as n -> oo.
Conjecture: Sum_{k=1..n} a(k) ~ n^2 / 2 (see the plot in the Links section).

A379153 The binary weights of the Apéry numbers (A005259).

Original entry on oeis.org

1, 2, 3, 6, 6, 14, 15, 15, 20, 19, 23, 23, 27, 34, 35, 44, 40, 36, 40, 44, 41, 48, 52, 62, 64, 66, 57, 66, 72, 79, 71, 75, 77, 78, 79, 78, 88, 86, 92, 100, 103, 103, 92, 116, 96, 116, 117, 113, 129, 117, 123, 128, 123, 126, 130, 133, 129, 142, 147, 134, 135, 148
Offset: 0

Views

Author

Amiram Eldar, Dec 17 2024

Keywords

Crossrefs

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

Programs

  • Mathematica
    a[n_] := DigitCount[Sum[(Binomial[n, k] * Binomial[n+k, k])^2, {k, 0, n}], 2, 1]; Array[a, 100, 0]
  • PARI
    a(n) = hammingweight(sum(k=0, n, (binomial(n, k)*binomial(n+k, k))^2));

Formula

a(n) = A000120(A005259(n)).
a(n) > c * (log(n)/log(log(n)))^(1/4) holds on a set of n of asymptotic density 1, where c > 0 is a constant (Luca and Shparlinski, 2010).
a(n) > c * log(n)/log(log(n)) holds on a set of n of asymptotic density 1, where c > 0 is a constant (Knopfmacher and Luca, 2012).
Conjecture: Limit_{m->oo} (1/m^2) * Sum_{k=1..m} a(k) = log(sqrt(2) + 1)/log(2) = 1.2715533... (Knopfmacher and Luca, 2012).

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).
Showing 1-3 of 3 results.