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.

A326819 Irregular triangle read by rows; for n >= 0, the n-th row corresponds to the elements of the set {(n-k) AND k, k = 0..n}, in ascending order (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 2, 0, 2, 0, 1, 3, 0, 0, 1, 2, 4, 0, 2, 4, 0, 1, 3, 4, 5, 0, 4, 0, 1, 2, 5, 6, 0, 2, 6, 0, 1, 3, 7, 0, 0, 1, 2, 4, 8, 0, 2, 4, 8, 0, 1, 3, 4, 5, 8, 9, 0, 4, 8, 0, 1, 2, 5, 6, 8, 9, 10, 0, 2, 6, 8, 10, 0, 1, 3, 7, 8, 9, 11, 0, 8, 0, 1, 2, 4, 9, 10, 12
Offset: 0

Views

Author

Rémy Sigrist, Oct 20 2019

Keywords

Comments

For any n >= 0, the n-th row:
- has sum A328564(n),
- has apparently length A002487(n+1),
- has first element 0,
- has last element A104594(n).

Examples

			Table begins:
    0;
    0;
    0, 1;
    0;
    0, 1, 2;
    0, 2;
    0, 1, 3;
    0;
    0, 1, 2, 4;
    0, 2, 4;
    0, 1, 3, 4, 5;
    0, 4;
    0, 1, 2, 5, 6;
    0, 2, 6;
    0, 1, 3, 7;
    ...
		

Crossrefs

Cf. A326820 (OR variant), A328568 (XOR variant).

Programs

  • Maple
    T:= n-> sort([{seq(Bits[And](n-k, k), k=0..n)}[]])[]:
    seq(T(n), n=0..30);  # Alois P. Heinz, Oct 20 2019
  • PARI
    row(n) = Set(apply(k -> bitand(n-k, k), [0..n]))