Let $\displaystyle f$ be a function on the positive integers defined by

$\displaystyle f(n)=\begin{cases}

\displaystyle\frac{n}{2}&\text{if }n\text{ is even}\\

n+1&\text{if }n\text{ is odd}

\end{cases}$

Now let $\displaystyle g(n)$ be defined as the number of times $\displaystyle f$ must be applied to $\displaystyle n$ for it to first equal 1.

For example, $\displaystyle g(2)=1$ because $\displaystyle f(2)=1$ and $\displaystyle g(5)=5$ because $\displaystyle f(f(f(f(f(5)))))=1$.

How many solutions are there to the equation $\displaystyle g(n)=20$