Let $p$ be a prime. Prove that if both $p$ and $pa$ can be written as a sum of two squares, then so is $a$.
My attempt :
By Fermat's two square theorem, the expression of a prime, $p\equiv1\bmod{4}$ as the sum of two squares is unique.
Let $p = x^2+y^2$
Suppose $gcd(x,y) \not= 1$, let $gcd(x,y)=d$
then $d\mid x$, $d\mid y$ so $d^2\mid x^2+y^2$ i.e., $d^2\mid p$, contradiction.
so $gcd(x,y) =1$ then there exists $t_1, t_2 \in\mathbb{Z}$ that $t_1x+t_2y=1$
so $a = at_1x+at_2y$