Suppose odd prime $p=a^2+b^2$, and $a$ is odd and $b$ is even. Prove that if $b\equiv2\pmod4$, then $\left(\dfrac bp\right)=-1$ and if $b\equiv0\pmod4$, then $\left(\dfrac bp\right)=1$.
What I have got is that $p\equiv 1 \pmod4$. I have tried factoring $b$ and splitting up the Legendre symbols. However, I am not sure this gets anywhere because you cannot say much about those. I have also observed that $b \equiv 0 \pmod 4$ when $p\equiv 1 \pmod 8$ and $b \equiv 2 \pmod 4$ when $p\equiv 5 \pmod 8$ if that helps.