OFFSET
1,2
COMMENTS
LINKS
Eric Weisstein's World of Mathematics, CollatzProblem
Wikipedia, Collatz conjecture
MATHEMATICA
a033493[n_] := Block[{f}, f[1] = 1; f[x_Integer?OddQ] := 3 x + 1; f[x_Integer?EvenQ] := x/2; -1 + Plus @@ FixedPointList[f, n]]; Select[Range[10^5], IntegerQ[a033493[#]/#] &] (* Michael De Vlieger, Feb 09 2015, after Alonso del Arte at A033493 *)
PROG
(PARI) Tsum(n)=s=n; while(n!=1, if(n==Mod(0, 2), n=n/2; s+=n); if(n==Mod(1, 2)&&n!=1, n=3*n+1; s+=n)); s
for(n=1, 10^6, if(type(Tsum(n)/n)=="t_INT", print1(n, ", ")))
CROSSREFS
KEYWORD
nonn,more,hard
AUTHOR
Derek Orr, Feb 07 2015
STATUS
approved