TITLE: Prove that $x^2-y^2=10$ has no integer solution
QUESTION [5 upvotes]: I am trying to provide a proof by contradiction that $$x^2-y^2=10$$ has no integer solution. This is what I did, I am not sure it is correct, since it appears so simple...
Suppose an integer solution exists.
It follows that $$(x-y)(x+y)=10$$
At least one of these has to be even for 10 to be even. Without loss of generality I assume that $$(x+y)$$ is even.
It follows that $$x+y=2c$$ with c an integer
$$2c(x-y)=10$$
$$c(x-y)=5$$
Then both c and $(x-y)$ have to odd, but this contradicts the claim that $(x+y)$ is even.
Am I making an incorrect assumption in one of these steps?

REPLY [3 votes]: As DonAntonio said, for any integer $n$,  $n^2\equiv 0\bmod4$ or $n^2\equiv 1\bmod4$
LHS:
$$x^2\equiv0\text{ or }1\bmod4$$
$$y^2\equiv0\text{ or }1\bmod4$$
$$\implies x^2-y^2\equiv(0-0)\text{ or }(0-1)\text{ or }(1-0)\bmod4$$
(i.e) The possible remainders when $x^2-y^2$ is divided by $4$ are $\{-1,0,1\}\\$
RHS:
$$10\equiv2\bmod4$$
Since $2\notin\{-1,0,1\}$, $x^2-y^2\neq10$ when $x$ and $y$ are integers.

Ok, Why does $n^2\equiv 0\bmod4$ or $n^2\equiv 1\bmod4\ $ (where $n\in\mathbb{z}$)?
Case 1: $n$ is even:
$$n=2k \text{ (where } k\in\mathbb{z})$$
$$n^2=4k^2\text{ and } 4k^2\equiv0\bmod4$$
$$\implies n^2\equiv0\bmod4 \text{ when } n \text{ is even}$$
Case 2: $n$ is odd:
$$n=2k+1 \text{ (where } k\in\mathbb{z})$$
$$n^2=(2k+1)^2$$
$$=4k^2+4k+1$$
$$=4(k^2+k)+1$$
$$\implies n^2\equiv1\bmod4 \text{ when } n \text{ is odd}$$
Hence $n^2$ ($n\in\mathbb{z}$) leaves either $0$ or $1$ as a remainder when divided by $4$