OFFSET
1,2
EXAMPLE
6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1, so a(3) is the decimal equivalent of 10101111, which is 175.
MATHEMATICA
f[x_] := If[EvenQ[x], x/2, 3x + 1]; g[n_] := FromDigits[Mod[Most[NestWhileList[f, 2n, # > 1 &]], 2, 1] - 1, 2]; Table[g[n], {n, 40}] (* Ray Chandler, Feb 02 2007 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Feb 01 2007
EXTENSIONS
Extended by Ray Chandler, Feb 02 2007
STATUS
approved