

A220071


Difference between number of halving steps and number of tripling steps needed to reach 1 in '3x+1' problem.


3



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS

This sequence can also be defined as: a(1) = 0; thereafter a(2*k) = a(k) + 1, a(2*k+1) = a(6*k+4)  1.  Gionata Neri, Jul 17 2016


LINKS



FORMULA



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:


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 *)


CROSSREFS



KEYWORD

nonn


AUTHOR



EXTENSIONS



STATUS

approved



