12

Python 2, 49 bytes
f=lambda n,x=1:1/n*x or f(n/2-n%2*~n,x-n%2*~x<<1)
Try it online!
Explanation
Notice the following: if n is odd, 3*n+1 must be even. This means that in the odd case, we can combine two steps into one, with (3*n+1)/2. Although it seems more complicated, the formula actually bec...