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
Alois P. Heinz, Table of n, a(n) for n = 1..10000
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jayanta Basu, Feb 19 2013
EXTENSIONS
More terms from Alois P. Heinz, Feb 19 2013
STATUS
approved