A125710 In the "3x+1" problem, let 0 denote a halving step and 1 denote an x->3x+1 step. Then a(n) is obtained by writing the sequence of steps needed to reach 1 from 2n+1 and reading it as a decimal number.
4, 80, 16, 43280, 305424, 10512, 272, 87056, 2320, 665872, 64, 21520, 4860176, 1676649379371438023024192690344976, 141584, 54056611079304389108412587463696, 38414608, 5136, 1091856, 11358841104
Offset: 0
Examples
7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1, so a(3) is the decimal equivalent of 1010100100010000, which is 43280.
Programs
-
Mathematica
f[x_] := If[EvenQ[x], x/2, 3x + 1];g[n_] := FromDigits[Mod[Most[NestWhileList[f, 2n + 1, # > 1 &, {2, 1}]], 2], 2];Table[g[n], {n, 0, 30}] (* Ray Chandler, Feb 02 2007 *)
Extensions
Extended by Ray Chandler, Feb 02 2007