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.

A074472 Length of iteration sequence of Collatz-function (A006370) when initial value is 3^n (A000244) and final cycle is followed once.

Original entry on oeis.org

1, 8, 20, 112, 23, 97, 34, 77, 76, 44, 136, 135, 134, 133, 145, 206, 130, 191, 141, 96, 95, 262, 429, 92, 259, 395, 332, 256, 255, 391, 390, 389, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 502, 501, 451, 499, 498, 753, 496, 495, 494, 749, 492, 747, 490
Offset: 0

Views

Author

Labos Elemer, Sep 19 2002

Keywords

Examples

			n=2: initial value=3^2, list of iterates is {9,28,14,7,22,11,34,17,52,26,13,50,20,10,5,16,8,4,2,1} length=a(2)=20; Observe that consecutive powers of 3 as arguments frequently provide iteration-lengths of consecutive integers, for instance n=10,11,12,13 give L=136,135,134,133 or n=88-96 result in L=1278-1271.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := (1-Mod[x, 2])*(x/2)+(Mod[x, 2])*(3*x+1); f[1]=1; Table[1+Length[FixedPointList[f, 3^w]], {w, 1, 100}]