# How to prove there doesn't exist $a,b \in \Bbb Z$ with $|a^2-5b^2|=2$

As it says in the headline, how does one prove that there doesn't exist $a, b$ $\in \Bbb Z$ with $|a^2-5b^2=2|$? Any hints?

-

$5b^2\pm2\equiv \pm2\pmod 5$

$a$ can be of the form $5k,5k\pm1,5k\pm2$ where $k$ is any integer.

But $(5k)^2\equiv 0\pmod 5,(5k\pm1)^2\equiv 1\pmod 5, (5k\pm2)^2\equiv 4\equiv -1\pmod 5,$

So, $a^2\equiv 0,\pm1\pmod 5\not\equiv\pm2$

Observation: $2\equiv-3, -2\equiv 3$ are quadratic non-residues of $5$, unlike $1\equiv -4,-1\equiv 4$.

-
I was just about to write this :) +1 – Belgi Nov 19 '12 at 5:45

Hint $\rm\ \ (a\!-\!b)(a\!+\!b) = 4b^2 \pm 2\:\Rightarrow\:2\mid a\pm b\:\Rightarrow\:4\mid 2\:\Rightarrow\Leftarrow$

-

For this to be true, you would need either:

$a^2 - 5b^2 = 2$ or $a^2 - 5b^2 = -2$.

Reducing modulo $5$, the first equation becomes $a^2 = 2$ mod $5$.

Similarly, the second equation becomes $a^2 = 3$ mod $5$.

But any square reduced modulo $5$ must be $0, 1,$ or $4$.

So neither equation can hold for integers $a$ and $b$.

-

$n^2 \in \{0, 1\}$ ($\bmod$ $4$) for all integral $n$ and $x^2 - 5y^2 \equiv x^2 - y^2$ ($\bmod$ $4$). The difference of two squares can only be $-1 (\equiv 3), 0$ or $1$ ($\bmod$ $4$).

-

HINT: Suppose that $|a^2-5b^2|=2$; then either $a$ and $b$ are both odd, or they’re both even. (Why?) If they’re both even, $a^2-5b^2$ is a multiple of $4$. (Why?) If $a$ is odd, then $a^2$ is either a multiple of $5$ or one more than a multiple of $5$. (Why?)

-

Hint: For any $x$, we have $x^2\equiv 0\pmod{5}$ or $x^2\equiv 1\pmod{5}$.

-
Per chance you mean : for any odd $x$? because 2² satisfies not your conclusion... I mean : take $x=2$. – awllower Nov 19 '12 at 5:47

First show that $a$ and $b$ must be relatively prime to 2, then show that 2and -2 are not quadratic residues modulo 5. So one concludes that $|a²-5b²|=2$ has no solution in integers.

-