Prove the following:
Let $p$ be prime such that $p ≡ 1 \pmod 4$ and $k$ be a natural number. We can write $n = p^k$ as a sum of two squares.
There are two cases for $k$, even $k=2m$ and odd $k=2m+1$, for some integer $m$.
Case $k$ even
If $k$ is even, then $n=p^{2m}=(p^m)^2+0^2$.
Case $k$ odd
Since $p \equiv 1 \pmod 4$, we can write it as the sum of two squares, by the Sum of Two Squares Theorem (8.5). That is, for some natural numbers $a,b$
$$ p = a^2 + b^2 $$
If $k$ is odd, then
$$ n = p^{2m+1}=p^{2m} \times (a^2+b^2) = (p^m)^2 \times (a^2+b^2) = a^2(p^m)^2 + b^2(p^m)^2 = (ap^m)^2+(bp^m)^2 $$
In both cases we have shown $n$ can written as the sum of two squares.