TITLE: Using Fermat's Little Theorem to solve a Diophantine equation.
QUESTION [5 upvotes]: How to prove that the equation $x^2+5=y^3$ has no integer solutions? I have proved the case when $x$ is odd. I used the fact $x^2\equiv 1 \pmod 4$ but how would you do for even $x$: the mod 4 analysis becomes useless. The problem is from Fermat Little Theorem section. But I do not know how apply it. Thanks

REPLY [4 votes]: Here is a proof. First note that, $y$ cannot be congruent to $3$ modulo $4$. Indeed, had it been; then we would have had
$$
x^2 + 5\equiv y^3 \equiv27\pmod{4}\implies x^2 \equiv2\pmod{2},
$$
a contradiction. With this in mind, rewrite the equation as,
$$
x^2+4 = y^3 - 1=(y-1)(y^2+y+1).
$$
Now, we claim that right hand side always has a prime divisor of form $4k+3$. Indeed, if $y\equiv 0\pmod{4}$, then $y-1\equiv3\pmod{4}$, hence it has such a prime divisor; and if $y\equiv1$ or $y\equiv2$ modulo $4$, $y^2+y+1$ has a prime divisor congruent to $3$ modulo $4$.
Equipped with the following well-known lemma, we are done. If $p\equiv 3\pmod{4} $ a prime, then
$$
p\mid x^2+y^2 \implies p\mid x \ \text{and} \ p\mid y.
$$
Applying the lemma we conclude for this prime divisor that $p\mid x^2+2^2$ implies $p \mid 2$, contradiction. Done.