OFFSET
1,3
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=9: iteration-list = [9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]; peak = 52 at 9th position, so a(9) = 9.
MATHEMATICA
Collatz[n_] :=NestWhileList[If[EvenQ[#], #/2, 3*# + 1] &, n, # > 1 &]; Flatten[Table[Position[Collatz[n], Max[Collatz[n]]], {n, 96}]] (* Jayanta Basu, Mar 24 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Aug 27 2003
STATUS
approved