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$?
 A: The remainder when you divide a number by $6$ can only be $0,1,2,3,4,5$.
Furthermore, $4 \equiv -2 \pmod{6}$ and $5 \equiv -1 \pmod{6}$.
After that, you just have to enumerate the $6$ cases to verify that it is true.
A: Induction:

*

*Check the validity for the base $a=1$.
$$1(2)(3)$$ is divisible by 6. As it passes the first step, then we continues to the next step.


*Assume the claim is valid for $a=k$. Or we can express as
$$k(k+1)(2k+1)=6m$$


*Check again for $a=k+1$.
\begin{align}
   (k+1)(k+2)(2k+3) &= k(k+1)(2k+1) + 6(k+1)^2\\
                    &= 6m + 6 n\\
                    &= 6(m+n)
  \end{align}
which is obviously divisible by 6.
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$?

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$.
A: Hint:
It's much better to use:
$$a(a+1)(2a+1)=a(a+1)(2(a-1)+3)=2\underbrace{(a-1)a(a+1)}_{\text{ The product of } 3\text{ consecutive integers }}+3a(a+1)$$
Use The product of $n$ consecutive integers is divisible by $n$ factorial
