0
$\begingroup$

Prove that if $5 \nmid (n-1), 5 \nmid n, 5 \nmid (n+1),$ then $5 | (n^2+1)$. I found that $(n-1)(n+1)(n^2+1)n = n^5-n$. I know by Fermat's little theorem that $5|n^5-n$ but I don't understand the logic behind taking the product of the terms.

4 Answers 4

1

Hint $\,{\rm mod}\ 5\!:\ n^2+1\equiv n^2-4\equiv \color{#c00}{(n-2)(n+2)}\,$ so your claim is equivalent to $$\, \color{#0a0}{n\not\equiv 0,\pm1} \,\Rightarrow\, \color{#c00}{n\equiv \pm2} \!\!\pmod{5}$$

Or, equivalently, $\,5$ divides one of the $5$ consecutive integers $ \color{#c00}{n-2},\,\color{#0a0}{n-1,\,n,\,n+1},\,\color{#c00}{n+2}\,$

2

The logic behind it is the use of the generalized Euclid's lemma, i.e., given a prime number $p$ such that $p\mid a_1\cdot a_2\cdots a_n$, then there is some $a_i$ such that $p\mid a_i$.

In your problem we have $p=5$, $a_1=n-1$, $a_2=n+1$, $a_3=n$ and $a_4=n^2+1$. Because $5\mid n^5-5$, as you noted, then by the generalized Euclid's lemma $5$ must divide at least one of $n-1, n, n+1$ or $n^2+1$, but since $5\not\mid n-1$, $5\not\mid n$ and $5\not\mid n+1$, the only option is $5\mid n^2+1$.

1

Because 5 is prime, if 5 divides a product of several terms (all of which are whole numbers) then it must divide one of the terms.

1

$n= \pm 2 \mod 5 \implies n^2=-1 \mod 5 \implies n^2+1 =0 \mod 5 \implies 5 \mid n^2+1$