I have two recursion equations that seem to be equivalent. I need a method to show the equivalence relation between them. The equations calculate number of ones in binary representation of the number. The equations are given below:
1) $$ f(0) = 0 $$ $$ f(n) = \begin{Bmatrix} f(n-1)+1 & \text{if n is odd} \\ f(\frac{n}{2}) & \text{if n is even} \end{Bmatrix} $$
2) $$ g(0) = 0$$ $$g(n)=g(n-2^{\lfloor log_2{(n)}\rfloor})+1$$
I thought about using induction, but I have no clue how to use it along with recursive equations. Any help will be appreciated.