If a prime can be expressed as sum of two squares, then prove that the representation is unique.
My attempt:
If $a^2+b^2=p$, then it is obvious that $a,b$ of different parity.
Now, I assume the contraposition that the representation is not unique, $p=a^2+b^2=c^2+d^2$. Again, $c,d$ are of different parity.
Now, let $b,d$ be even and $a,c$ be odd.
So, $a^2+b^2=c^2+d^2 \implies a^2-c^2=d^2-b^2 \implies (a+c)(a-c)=(d-b)(d+b)$.
I cannot proceed any further. Please help.
The slickest way is via a little Algebraic Number Theory. If $p=a^2+b^2=c^2+d^2$ then $$p=(a+bi)(a-bi)=(c+di)(c-di)$$ Now ${\bf Z}[i]$ is a unique factorization domain, so these two factorizations of $p$ show that $a+bi$ can't be a prime in ${\bf Z}[i]$. We must have a non-trivial factorization $a+bi=(s+ti)(u+vi)$, whence $a-bi=(s-ti)(u-vi)$, and then $$p=(s^2+t^2)(u^2+v^2)$$ contradicting primality of $p$.
There are ways to answer your question without these advanced concepts, but I can never remember how it's done. I'm sure someone else will.