Algorithm to decompose a number into the product of an integer and a base two exponencial So i`ve been asked to code an algorithm that decomposes an integer into the product of a base two exponencial and some integer.Something like number = k.(2^n) , k and n being random integers with k restricted to being odd.

My question is not about the programming aspect of this problem but rather the algebraic one as i have failed to came up with a standard procedure into finding one.The problem says thats the combination k.(2^n) is unique for every integer, so i`ve managed to find the combinations for certian numbers but it gets exponencially dificult as the number increases.

For example, given the number 12 the only possible combination under this restrictions is 12 = 3(2^2)

Please feel free to edit and improve anything you feel necessary as english is not my mother language

One simple way is to start with the $k$ you are given and $n=0$.  Then divide $k$ by $2$ as many times as possible, incrementing $n$ each time.  
while $k$ is even
$\quad   k=k/2  $
$\quad   n=n+1$
