# show the p is a sum of two squares - number theory [duplicate]

If $p$ is a the sum of two squares are integers $a$ and $b$ s.t. $p=a^2 + b^2$ then $p=1$ mod $4$. I need help proving that.

## marked as duplicate by draks ..., Nick Peterson, Dan Rust, Norbert, Lord_FarinOct 17 '13 at 11:30

• This isn't actually true...it could be $p \equiv 0 \pmod 4$. Do you mean to assume that $p$ is prime? – DanielV Oct 17 '13 at 10:35
Take $\;\Bbb Z/4\Bbb Z=\{0,1,2,3\}\pmod 4\;$ and observe what's the general form of its squares.
Now take the expression $\;a^2+b^2\pmod 4\;$ . Taking into account the first point and the fact that $\;p\;$ is a prime, what can you deduce?