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.

Showing 1-1 of 1 results.

A080825 Triangle read by rows in which n-th row gives trajectory of n (omitting n itself) under the map k -> k-1 if k odd, k -> k/2 if k even.

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 2, 1, 3, 2, 1, 6, 3, 2, 1, 4, 2, 1, 8, 4, 2, 1, 5, 4, 2, 1, 10, 5, 4, 2, 1, 6, 3, 2, 1, 12, 6, 3, 2, 1, 7, 6, 3, 2, 1, 14, 7, 6, 3, 2, 1, 8, 4, 2, 1, 16, 8, 4, 2, 1, 9, 8, 4, 2, 1, 18, 9, 8, 4, 2, 1, 10, 5, 4, 2, 1, 20, 10, 5, 4, 2, 1, 11, 10, 5, 4, 2, 1, 22, 11, 10, 5, 4, 2, 1, 12, 6, 3
Offset: 2

Views

Author

Cino Hilliard, Mar 27 2003

Keywords

Comments

If you write down 0 when divide by 2, 1 when subtract 1, the trajectory gives the binary expansion of n.

Examples

			Triangle begins:
1;
2,1;
2,1;
4,2,1;
3,2,1;
6,3,2,1;
...
7 -> 6 -> 3 -> 2 -> 1, so the 7th row is 6,3,2,1.
		

Crossrefs

A082404 is a better version.

Programs

  • PARI
    xnm1(n,p) = { print1(1" "); for(x=1,n, p1 = x; while(p1>1, if(p1%2==0,p1/=2,p1 = p1*p-1;); print1(p1" ") ) ) }

Extensions

Edited by N. J. A. Sloane, Dec 06 2008 at the suggestion of R. J. Mathar
Showing 1-1 of 1 results.