It seems like you haven't yet heard of the rather well-known theorem that says that a prime is expressable as the sum of two squares

iff it is 1 mod 4, so I think you'll have to prove it. It appears in pretty much every decent number theory book and in thousands of internet sites.

Tonio