<s>[INST] Expression of an Integer as a Power of 2 and an Odd Number (Chartrand Ex 5.4.2[a]) 
Let $n$ be a positive integer. Show that every integer $m$ with $ 1 \leq m \leq 2n $ can be expressed as $2^pk$, where $p$ is a nonnegative integer and $k$ is an odd integer with $1 \leq k < 2n$.

I wrote out some $m$ to try to conceive the proof. I observed: 
$\bbox[5px,border:1px solid grey]{\text{Case 1: $m$ odd}}$ Odd numbers $\neq 2p$, thus the only choice is to put $p = 0$ and $k = m$.
$\bbox[5px,border:1px solid grey]{\text{Case 2: $m$ even and power of 2}}$ Then $p$ can be determined by division or inspection to "square with" the power of $2$. This requires $k = 1$. Is an explicit formula for $p$ necessary?
$\bbox[5px,border:1px solid grey]{\text{Case 3: $m$ even and NOT A power of 2}}$ 
$\begin{array}{cc}
\\
\boxed{m = 6}: 6 = 2^1 \cdot 3 \qquad \qquad & \boxed{m = 10}: 10 = 2^1 \cdot 5 \qquad  \qquad & \boxed{m = 12}: 12 = 2^2 \cdot 3  \\
\boxed{m = 14}: 14 = 2 \cdot 7 \qquad \qquad & \boxed{m = 18}: 18 = 2^1 \cdot 9 \qquad  \qquad & \boxed{m = 20}: 20 = 2^2 \cdot 5\\
\boxed{m = 22}: 22 = 2 \cdot 11 \qquad \qquad & \boxed{m = 24}: 24 = 2^3 \cdot 3 \qquad  \qquad & \boxed{m = 26}: 26 = 2^1 \cdot 13
\end{array}$

Solution's Proof by Contradiction: $\color{#0073CF}{\Large{\mathbb{[}}}$Let $p$ be the greatest nonnegative integer
  such that $2^p | m. \color{#0073CF}{\Large{\text{]}}}$ $\color{red}{\Large{\text{[}}}$ Then $m= 2^pk$ for some positive integer $k$. Necessarily $k$ is odd,
  for otherwise this would contradicts the definition of $p$. $\color{red}{\Large{\text{]}}}$

$\Large{\text{1.}}$ Could someone please expound on the answer? It differs from my work above?
$\Large{\text{2.}}$ Is there a general formula/pattern for Case $3$? 
I referenced 1. Source: Exercise 5.42(a), P125 of Mathematical Proofs, 2nd ed. by Chartrand et al
 [/INST] $p$ is the greatest integer such that $2^p$ divides $m$. 
This means that : 


*

*there exists an integer $k$ such that $m = 2^p k$

*for any integer $q$, if there is an integer $l$ such that $m = 2^q l$, then $p \ge q$.
Suppose the $k$ you get by 1. is even. Then $k = 2l$ for some integer $l$. Hence $m = 2^p(2l) = 2^{p+1}l$. Now apply 2. with $q = p+1$ : you get that $p \ge p+1$. This is a contradiction, so $k$ must be odd.
For example, let $m = 24$. It turns out that $24 = 2^3 * 3$, so $2^3$ divides $24$. $3$ is the greatest integer $p$ such that $2^p$ divides $m$ (you can indeed check that $16,32,64,128,\ldots$ don't divide $24$) and so we find that indeed, $3$ is odd and $24 = 2^3 * 3$ was the decomposition we wanted.
The solution gave you not an algebraic formula for $p$ (as you may have wanted), but a logical formula for $p$, which is the next best thing, as it tells you exactly which $p$ you have to take.
</s>