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.

A371572 Irregular triangle read by rows: row n lists the 1-based positions (starting from the left) of ones in the binary expansion of n, with row 0 = 0.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 1, 3, 1, 2, 1, 2, 3, 1, 1, 4, 1, 3, 1, 3, 4, 1, 2, 1, 2, 4, 1, 2, 3, 1, 2, 3, 4, 1, 1, 5, 1, 4, 1, 4, 5, 1, 3, 1, 3, 5, 1, 3, 4, 1, 3, 4, 5, 1, 2, 1, 2, 5, 1, 2, 4, 1, 2, 4, 5, 1, 2, 3, 1, 2, 3, 5, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 1, 6, 1, 5, 1, 5, 6
Offset: 0

Views

Author

Paolo Xausa, Mar 28 2024

Keywords

Examples

			Triangle begins:
  [0] 0;
  [1] 1;
  [2] 1;
  [3] 1, 2;
  [4] 1;
  [5] 1, 3;
  [6] 1, 2;
  [7] 1, 2, 3;
  [8] 1;
  ...
Row n = 50 is 1, 2, 5:
  binary expansion of 50: 1 1 0 0 1 0
  positions of ones:      1 2 - - 5 -
		

Crossrefs

Cf. A230877 (row sums), A371571 (position of zeros).
Cf. A048793.

Programs

  • Mathematica
    Join[{{0}}, Array[Flatten[Position[IntegerDigits[#, 2], 1]] &, 50]]