Why is $n(n+1)$ is congruent to 0,1, or 2 modulo 5?

170 Views Asked by At

I am trying to understand the following proof:

Show that the difference of two consecutive cubes is never divisible by 5.

For any integer $n$, we have $(n + 1)^3 − n^3= 3n(n + 1) + 1$, and

it is easily seen that $n(n + 1)$ is congruent to $0, 1,$ or $2$ modulo $5$

so that $(n + 1)^3 − n^3$ can only be congruent to $1, 2,$ or $4$ modulo $5$.

How did the author of this proof arrive at the highlighted part? I am having trouble justifying it and determining why it is true.

Thanks!

2

There are 2 best solutions below

4
On BEST ANSWER

There is just a couple of possibilities to check.

  1. If $n \equiv 0 \pmod{5}$ or $n \equiv 4 \pmod{5}$, then $n(n+1) \equiv 0 \pmod{5}$.
  2. If $n \equiv 1 \pmod{5}$ or $n \equiv 3 \pmod{5}$, then $n(n+1) \equiv 2 \pmod{5}$.
  3. If $n \equiv 2 \pmod{5}$ , then $n(n+1) \equiv 1 \pmod{5}$.
0
On

Just consider all cases: $$ \begin{array}{rrrrrr} n \bmod 5 : & 0 & 1 & 2 & 3 & 4 \\ n^2+n \bmod 5 : & 0 & 2 & 1 & 2 & 0 \end{array} $$