<s>[INST] Integral solution and odd prime Here is my question:

Let $p\neq 7$ be an odd prime. Suppose that only one of the two equations,
  $$
x^2 + 7y^2 = p, \quad x^2 - 7y^2 = p
$$
  has integral solution $(x,y)$. Prove that $p \equiv 3\;(\mathrm{mod}\; 4)$.

What I have done is that in modulo $7$, $x^2$ can be $1, 2$ or $4$.
And in modulo $4$, $x^2$ can be $0$ or $1$.
But I don't know how to prove that $p$ is not congruent $1$ modulo $4$ when only one of two equation has an integral solution.
 [/INST] First we show that there are integers $x$ and $y$ such that $x^2+7y^2=p$, and $p$ is a prime not equal to $7$, then $-7$ is a quadratic residue of $p$.
If $x^2+7y^2=p$, then $y$ is not divisible by $p$. For suppose to the contrary that $p$ divides $y$. Then $p$ divides $x$, so $p^2$ divides $x^2+7y^2$, which is impossible.
If $x^2+7y^2=p$, then $-7y^2\equiv x^2\pmod{p}$. If we multiply both sides by $u^2$, where $u$ is the inverse of $y$ modulo $p$, we find  that $(xu)^2\equiv-7$, so is a quadratic residue of $p$.  
A similar argument shows that if $x^2-7y^2=p$, then $7$ is a quadratic residue of $p$.
Now suppose that $p\equiv 1\pmod{4}$. Then $-1$ is a QR of $p$. It follows that $-7$ is a QR of $p$ if and only if $7$ is a QR of $p$.
But since exactly one the equations $x^2+7y^2=p$ and $x^2-7y^2=p$ has a solution, exactly one of $-7$ and $7$ is a QR of $p$. Thus $p$ cannot be of the form $4k+1$, so it is of the form $4k+3$.
</s>