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.

A382467 Irregular triangle read by rows, where row n lists the integers from 0 to 2^n - 1 sorted by the number of zeros in their binary representation (in case of ties, by their decimal value).

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 2, 0, 1, 3, 7, 2, 5, 6, 4, 0, 1, 3, 7, 15, 2, 5, 6, 11, 13, 14, 4, 9, 10, 12, 8, 0, 1, 3, 7, 15, 31, 2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 4, 9, 10, 12, 19, 21, 22, 25, 26, 28, 8, 17, 18, 20, 24, 16, 0, 1, 3, 7, 15, 31, 63, 2, 5, 6, 11, 13, 14, 23, 27, 29, 30
Offset: 0

Views

Author

Paolo Xausa, Mar 31 2025

Keywords

Examples

			Triangle begins:
  [0]  0;
  [1]  0,  1;
  [2]  0,  1,  3,  2;
  [3]  0,  1,  3,  7,  2,  5,  6,  4;
  [4]  0,  1,  3,  7, 15,  2,  5,  6, 11, 13, 14,  4,  9, 10, 12,  8;
  ...
		

Crossrefs

Cf. A080791, A294648 (sorted by number of ones).
Main diagonal gives A000225.
Last elements of rows give A131577.
Row sums give A006516.

Programs

  • Maple
    b:= proc(n) b(n):= add(1-i, i=Bits[Split](n)) end:
    T:= n-> sort([$0..2^n-1], (x, y)-> b(x)Alois P. Heinz, Mar 31 2025
  • Mathematica
    Table[SortBy[Range[0, 2^n - 1], DigitCount[#, 2, 0] &], {n, 0, 6}]