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.

A218254 Irregular table, where row n (n >= 0) starts with n, the next term is n-A000120(n), and the successive terms are obtained by repeatedly subtracting the number of 1's in the previous term's binary expansion, until zero is reached, after which the next row starts with one larger n.

Original entry on oeis.org

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

Views

Author

Nico Brown, Oct 24 2012

Keywords

Examples

			The n-th row (starting indexing from zero) in this irregular table consists of block of length A071542(n)+1: 1,2,3,3,4,4,5,5,... which always ends with zero, as:
0
1,0
2,1,0
3,1,0
4,3,1,0
5,3,1,0
6,4,3,1,0
7,4,3,1,0
The 17th term is 6, which in binary is 110. The 18th term is then 6-2=4.
		

Crossrefs

Cf. A218252, A218253. A213707 gives the positions of zeros (i.e. the ending index of each row). A071542, A000120.
The reversed tails of the rows converge towards A179016.

Programs

  • PARI
    for(n=0,9,k=n;while(k, print1(k", "); k-=hammingweight(k)); print1("0, ")) \\ Charles R Greathouse IV, Oct 30 2012