OFFSET
0,4
REFERENCES
Gunther J. Wirsching, "The Dynamical System Generated by the 3n+1 Function" Lecture Notes in Mathematics (Springer Verlag, 1999), p. 1681
LINKS
K. Conrow, 3n+1 Problem Statement.
Jeffrey C. Lagarias, The 3x+1 problem and its generalizations, Amer. Math. Month1y v.92 (1985), pp. 3-23.
EXAMPLE
a(3)=2 because both 1 and 8 lead to 1 in 3 steps (1->4->2->1 and 8->4->2->1).
PROG
#!/usr/bin/perl @old = ( 1 ); while (1) { print scalar(@old), " "; @new = ( ); foreach $n (@old) { if (($n % 6) == 4) { push(@new, ($n-1)/3); } push(@new, $n+$n); } @old = @new; } sub numeric { return ($a <=> $b); }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Howard A. Landman, May 23 2003
STATUS
approved