It is a famous theorem due to Fermat that every prime 1 mod 4 can be written as sum of two squares of positive integers. On the other hand, it is not possible to represent primes 3 mod 4 as sum of two squares. The latter fact is reasonable easier to prove (Fermat’s little theorem immediately proves it).
But the proof that every prime 1 mod 4 can be written as sum of two squares is quite nontrivial. The proof I learned yesterday in Elementary Number Theory course was so beautiful and mysterious that I wrote it up in LaTeX and posted here.