Let $n=x^2+y^2$; $n=2^{2k}m$ or $n=2^{2k+1}m$ with $m$ odd. Prove that $2^{k}$ divides both $x$ and $y$. Let $n=x^2+y^2$ where x,y are integers, be one of the forms $n=2^{2k}m$ respectively $n=2^{2k+1}m$ with m odd. Prove that $2^{k}$ divides both x and y.

We prove something a little stronger. Let $2^a$ be the highest power of $2$ that divides both $x$ and $y$. We show that if $2^{2k}$ or $2^{2k+1}$ is the highest power of $2$ that divides $x^2+y^2$, then $a=k$. 
Since $2^a$ is the highest power of $2$ that divides both $x$ and $y$, we have  $x=2^a s$ and $y=2^at$, where $s$ and $t$ are not both even.
If $s$ and $t$ are of opposite parity, then $x^2+y^2=2^{2a}(s^2+t^2)$, and $s^2+t^2$ is odd. So $2^{2a}$ is the highest power of $2$ that divides $x^2+y^2$, and therefore $a=k$.
If $s$ and $t$ are both odd, then $s^2\equiv 1\pmod{4}$ and $t^2\equiv 1\pmod{4}$. It follows that $s^2+t^2\equiv 2\pmod{4}$. So the highest power of $2$ that divides $s^2+t^2$ is $2^1$. It follows that the highest power of $2$ that divides $x^2+y^2$ is $2^{2a+1}$. So again $a=k$. 
