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.

A307431 Number T(n,k) of partitions of n into parts whose bitwise OR equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 1, 0, 4, 0, 2, 0, 1, 1, 5, 0, 2, 2, 0, 1, 0, 7, 0, 2, 0, 5, 0, 1, 1, 8, 1, 2, 2, 6, 1, 0, 1, 0, 11, 0, 4, 0, 12, 0, 2, 0, 1, 1, 12, 0, 5, 4, 15, 0, 2, 2, 0, 1, 0, 15, 0, 5, 0, 28, 0, 2, 0, 5, 0, 1, 1, 17, 1, 5, 5, 35, 0, 2, 2, 6, 2
Offset: 0

Views

Author

Alois P. Heinz, Apr 08 2019

Keywords

Examples

			T(6,1) = 1: 111111.
T(6,2) = 1: 222.
T(6,3) = 5: 11112, 1122, 1113, 123, 33.
T(6,5) = 2: 114, 15.
T(6,6) = 2: 24, 6.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 0,  2;
  0, 1, 1,  2, 1;
  0, 1, 0,  4, 0, 2;
  0, 1, 1,  5, 0, 2, 2;
  0, 1, 0,  7, 0, 2, 0,  5;
  0, 1, 1,  8, 1, 2, 2,  6, 1;
  0, 1, 0, 11, 0, 4, 0, 12, 0, 2;
  0, 1, 1, 12, 0, 5, 4, 15, 0, 2, 2;
  ...
		

Crossrefs

Columns k=0-1 give: A000007, A057427.
Row sums give: A000041.
Main diagonal gives A050315.
Cf. A050314 (the same for XOR), A307432 (the same for AND).

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, x^k, `if`(i<1, 0,
          b(n, i-1, k)+b(n-i, min(n-i, i), Bits[Or](i, k))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..14);