A220071 Difference between number of halving steps and number of tripling steps needed to reach 1 in '3x+1' problem.
0, 1, 3, 2, 3, 4, 6, 3, 7, 4, 6, 5, 5, 7, 7, 4, 6, 8, 8, 5, 5, 7, 7, 6, 9, 6, 29, 8, 8, 8, 28, 5, 10, 7, 7, 9, 9, 9, 12, 6, 29, 6, 11, 8, 8, 8, 28, 7, 10, 10, 10, 7, 7, 30, 30, 9, 12, 9, 12, 9, 9, 29, 29, 6, 11, 11, 11, 8, 8, 8, 28, 10, 31, 10, 8, 10, 10, 13
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
Programs
-
Maple
a:= proc(n) option remember; `if`(n<2, 0, `if`(irem(n, 2)=0, 1+a(n/2), a((3*n+1)/2))) end: seq(a(n), n=1..100); # Alois P. Heinz, Feb 19 2013
-
Mathematica
coll[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[(x = Count[coll[n], ?EvenQ]) - (Length[coll[n]] - x - 1), {n, 78}] (* _Jayanta Basu, Aug 15 2013 *)
Formula
a(n) = a(A085062(n)) + 1 for n >= 2. - Alan Michael Gómez Calderón, Jan 26 2025
Extensions
More terms from Alois P. Heinz, Feb 19 2013
Comments