All $n$ such that $n+2$ is a cube and $n-2$ is a square.

131 Views Asked by At

I'm trying to find all integers $n$ such that $n+2$ is a cube and $n-2$ is a square.

I already know that only 6 and 123 are solutions but not know how to show it. I tried to use the proof of 26 being the only one such that $n+1$ is a cube and $n-1$ is a square but I'm having troubles doing it as in $\mathbb{Z}[i]$ I don't know how to conclude that if $y^3=x^2+4=(x+2i)(x-2i)$ then both $x+2i$ and $x-2i$ are cubes (It is at least true?).

Thank you very much.