$p\equiv 1\pmod 4\Rightarrow p=a^2+b^2$ and $p\equiv 1\pmod 8\Rightarrow p=a^2+2b^2$, what about for $p\equiv 1\pmod {2^n}$ in general Primes $p$ with $p\equiv 1\pmod 4$ can be written as $p=a^2+b^2$ for some integers $a,b$. For $p\equiv 1\pmod 8$ we have $p=a^2+2b^2$. Can primes that satisfy $p\equiv 1\pmod{2^n}$ for $n>3$ be written in a similar form -- for example $p=a^2+4b^2$ for $n=4$?

it gets harder, and we cannot just impose congruence conditions.
Added: one thing I've not seen in print is this: as soon as $p \equiv 1 \pmod 8,$ we find that $-1$ is a fourth power mod $p,$ and
$$ z^4  + 1 \equiv 0 \pmod p  $$
has four distinct roots.
A prime can be expressed as $p = x^2 + 32 y^2$   if and only if $p \equiv 1 \pmod 8$  and
$$ z^4 - 2 z^2 + 2 \equiv 0 \pmod p  $$
has four distinct roots.
A prime can be expressed as $p = x^2 + 64 y^2$   if and only if $p \equiv 1 \pmod 8$  and
$$ z^4 - 2  \equiv 0 \pmod p  $$
has four distinct roots.
The 64 result can be found under "biquadratic reciprocity." Both results may be due to Gauss, but were not published until Jacobi and Eisenstein.
