I know the theorem that $n = x^2 + y^2, \, \textrm{gcd}(x, y) = 1 \iff p | n \implies p \equiv 1 \bmod 4$. We call an expression of $n$ in this form primitive.
I'm trying to prove the statement. I've shown that if $p \mid n$ and $p \equiv 3 \bmod 4$ then $n$ has no primitive representation. Now I want to show the reverse direction, i.e. if $p \mid n \implies p \equiv 1 \bmod 4$ then $n = x^2 + y^2, \, \textrm{gcd}(x,y)=1$.
The strategy I'm currently exploring is to show that all primes which are $1 \bmod 4$ and their powers have primitive representations. I can do this. However, next I want to show that the product of two numbers with primitive representations also has a primitive representation. Let $m = a^2 + b^2; n = c^2 + d^2$ be two such numbers with respective primitive representations. Then I know $mn = (ac + bd)^2 + (ad - bc)^2$. I want to see if the terms on the RHS have $\textrm{gcd} = 1$, but I'm having trouble doing this.
Any help on my general approach or with this specific part would be nice. Thank you.