f:= proc(n) count := count +1; if n <> 1 then if n mod 2 = 0 then f(n/2) else f(3*n+1); fi;fi; end;