I have encountered the following argument in a number theory class:
Let $p$ be an odd prime and let $n,x$ and $y$ be integers with $\gcd(x,y) = 1$, $n > 0$ and $p \not \mid n$. Suppose that $p \mid x^2+ny^2$, it then follows that $\gcd(y,p) = 1$.
I do not understand why $\gcd(y,p) = 1$ should hold here. Could you give me a hint?
Since $p$ is prime, either it is coprime to $y$ or divides $y$. But it can't divide both $x$ and $y$, since they are coprime to each other, and it can't divide $y$ but not $x$, since then it would not divide $x^2+ny^2$.