Michel Lagneau, <a href="/A224183/b224183_1.txt">Table of n, a(n) for n = 1..10000</a>
Michel Lagneau, <a href="/A224183/b224183_1.txt">Table of n, a(n) for n = 1..10000</a>
proposed
approved
editing
proposed
Pontus von Brömssen, Michel Lagneau, <a href="/A224183/b224183_1.txt">Table of n, a(n) for n = 1..10000</a>
Michel Lagneau, Pontus von Brömssen, <a href="/A224183/b224183_1.txt">Table of n, a(n) for n = 1..10000</a>
approved
editing
proposed
approved
editing
proposed
printf(`%d, `, 01): for n from -2 by -1 to -100 do:x:=n:lst:={n}:for it from 1 to 100 do:if irem(x, 2)=0 then x := x/2: lst:=lst union{x} :else x := 3*x+1: lst:=lst union{x}fi:od:d:=nops(lst): printf(`%d, `, d-1): od:
proposed
editing
editing
proposed
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, UnsameQ, All]; Join[{0}, Table[s = Collatz[-n]; len = Length[s] - 2; If[s[[-1]] == 2, len = len - 1]; len, {n, 2, 1, 100}]]