find all natural number such that $n-2\mid n^2-2$

Find all natural numbers $n$ such that $$n-2\mid n^2-2$$ I don't know how to find "all natural numbers" Can someone help me prove the statement?

• By the Factor Theorem $\ n-2\mid f(n)-f(2)\,$ so $\,n-2\mid f(n)\iff n-2\mid f(2),\,$ for $f(x)$ any polynomial with integer coefficient, i.e. $\bmod n-2\!:\ f(n)\equiv f(2)\ \$ – Bill Dubuque Sep 26 '17 at 15:17

Let us assume then that $n\neq2$. Since $n^2-4=(n-2)(n+2)$, we always have $n-2\mid n^2-4$. If we also have $n-2\mid n^2-2$, then $n-2\mid 2$ and, of course, the reverse is also true. This (I mean, $n-2\mid2$) only happens if $n=1$, $n=3$, or $n=4$.

• $2$ is not solution, dear friend. – Piquito Sep 26 '17 at 13:59
• @Piquito I've edited my answer. Indeed, $0\nmid-2$. – José Carlos Santos Sep 26 '17 at 14:02
• How about $n=0$? – robjohn Feb 8 '18 at 22:38
• @robjohn As far as I am concerned, it is not a natural number. – José Carlos Santos Feb 8 '18 at 22:52

Hint:

$$\frac{n^2-2}{n-2}=\frac{n^2-2n+2n-2}{n-2}=n+\frac{2n-2}{n-2}=n+\frac{2n-4 +2}{n-2}=n+2+\frac{2}{n-2}$$

Instead of doing these little manipulations step by step you could also use polynomial long division and get the same result.

$$n-2\mid n^2-2\iff n^2-2=k(n-2)\Rightarrow n=\frac{k\pm\sqrt{k^2-8k+8}}{2}$$ The integer solutions of $k^2-8k+8=x^2$ are $(k,x)=(1,\pm1),(7,\pm1)$ so we get $$n=1,4,3$$

Assume $n-2\;|\;n^2-2$. Then $n-2\;|\;(n^2-2)-(n-2)=n^2-n=n(n-1)$.

Since $gcd(n-2,n-1)=1$, this implies $n-2\;|\;n$.

Can you go on from there?

Hint:

Set $n-2=m\iff n=?$

$n^2=(m+2)^2=m^2+4m+4$

$n-2|n^2-4+2$ so $n-2|(n-2)(n+2)+2$ so $n-2|2$...