If $p=a^2+4b^2$ for some $a,b \in \mathbb{Z}$, then $a$ is quadratic residu modulo $p$? If $p=a^2+4b^2$ for some $a,b \in \mathbb{Z}$ and $p$ prime, then $a$ is quadratic residu modulo $p$?
Approach: I thought it was true. (I could't find a counterexample). So I tried to prove it. I deduced that $a$ is a quadratic residu modulo $p$ iff $b$ is. Second I deduced that $p\equiv 1 \mod 4$ and that $a$ is odd. Can someone give me a hint on how to finish the proof? Thanks.

If $p=a^2+4b^2$ then $p\equiv 1\bmod{4}$ hence
$$
\left(\frac{a}{p}\right)=\left(\frac{p}{a}\right)=\left(\frac{p-a^2}{a}\right)=\left(\frac{(2b)^2}{a}\right)=1.
$$
