OFFSET
0,3
EXAMPLE
n = 6: list = {720, 360, 180, 90, 45, 136, 68, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 }
MATHEMATICA
f[x_] := (1-Mod[x, 2])*(x/2)+(Mod[x, 2])*(3*x+1) f[1]=1; f0[x_] := FixedPointList[f, x] le[x_] := Length[FixedPointList[f, x]]-1 Table[le[w! ], {w, 1, 50}]
Table[Length[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n!, #!=1&]], {n, 0, 50}] (* Harvey P. Dale, Apr 08 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 17 2003
STATUS
approved