So I know that if you take any even number $n$ that is a power of $2$ like $32 = 2^5,16=2^4$ or $64=2^6$ we will keep dividing by 2 until we reach 1. and so all the steps will be $\frac{n}{2}$ and we don't need to do any multiplication $3n+1$.
but for an even number like $18 =(2)(3^2)$ once we divide $\frac{18}{2}=9 = 3^2$ we have to carry out the $3n+1$ step
My question is can we generalize that to numbers that are not just powers of 2 ?
I want to figure out which numbers that don't need the $3n+1$ step
The only numbers which don't require the $3n+1$ step are those that are powers of two; you can prove this easily - if $c$ reaches $1$ after $n$ applications of $n\mapsto \frac{n}2$, then $\frac{c}{2^n}=1$ so $c=2^n$. More generally, if we apply the halving step exactly $n$ times to a $c$, then we get $\frac{c}{2^n}$, meaning $c=2^n\cdot k$ for some (odd) $k$ - so we are essentially removing all the twos from the prime factorization, and many authors compress all of that into one step.
Interestingly, similar methods can tell us what happens if we use $3n+1$ as much as possible - which is every other step, since $3n+1$ is even for odd $n$, so $n$ passes to $3n+1$ to $\frac{3n+1}2$. In particular, since $$\frac{3n+1}2=\frac{3}2(x+1)-1$$ it follows that if we apply that $n$ times, we get $$\left(\frac{3}2\right)^k(x+1)-1$$ which, in particular, means that the value $$2^k-1$$ always iterates, eventually, to $$3^k-1.$$