Proof that $a(a+1)(2a+1)$ is divisible by $6$ for every integer a This is from the book Elementary Number Theory by Jones & Jones
Example 3.6
Let us prove that a(a+1)(2a+1) is divisible by 6 for every integer a
By taking least absolute residues mod(6) we see that $a \equiv 0,\pm1,\pm2 or 3$.
If $a \equiv 0$ then $a(a+1)(2a+1) \equiv 0 \cdot 1 \cdot 1 \equiv 0$, if $a \equiv 1$, then $a(a+1)(2a+1) \equiv 1 \cdot 2 \cdot 3 = 6 \equiv 0$, and similar calculations (which you should try for yourself) show that $a(a+1)(2a+1) \equiv 0$ in the other 4 cases, so $6 \vert a(a+1)(2a+1)$ for all a.

I don't understand the proof at all starting with the first line - By taking least absolute residues mod(6) we see that $a \equiv 0,\pm1,\pm2 or 3$. - How does taking absolute residues mod(6) give $a \equiv 0,\pm1,\pm2 or 3$?


I don't understand the proof at all starting with the first line - By taking least absolute residues mod(6) we see that $a \equiv 0,\pm1,\pm2 or 3$. - How does taking absolute residues mod(6) give $a \equiv 0,\pm1,\pm2 or 3$?

Let us prove that f(a) := a(a+1)(2a+1) is divisible by 6 for every integer a
By taking least absolute residues mod(6) we see that $a \equiv 0,\pm1,\pm2\ or\  
 3$.


Shifting the standard system of residues (remainders)  $\,0,1,\ldots 5\pmod{\!6}\,$ shows that any sequence $\,R\,$ of $\,6\,$ consecutive integers forms a complete system of residues (or remainders), i.e. every integer $\,a\,$ it is congruent to a unique $\,r_i\in R.\,$ Now $\!\bmod 6\!:\ a\equiv r_i\,\Rightarrow\, f(a)\equiv f(r_i)\,$ by the Polynomial Congruence Rule. Hence if we prove that $\,f(r_i)\equiv 0\,$ for all $\,r_i\in R\,$ then we can conclude that for all integers $a$ we have $\,f(a)\equiv 0,\,$  i.e $\,6\mid f(a).\,$  They prove $\,f(r_i)\equiv 0\,$ when $\,r_i = 1\,$ and leave to the reader the proofs for the remaining five elements of $R$.
