Prove $5\nmid n(n+1)\implies 5\mid (n^3-6n^2+n-1)$. My try:
$5\nmid n(n+1)\implies 5\mid (n-2)(n-1)(n+2)=n^3-n^2-4n+4\implies$
$5\mid (n^3-n^2-4n+4)-(5n^2+ 5(n-1))=n^3-6n^2+n-1$.
This time a simple trick worked, but how to solve this (kind of) problem more methodically, maybe using modular arithmetic?
$$ n^3 - 6 n^2 + n - 1 \equiv n^3 - n^2 + n - 1 \equiv (n^2 + 1)(n-1) \pmod 5 $$
The hypothesis says that $n \neq 0,4 \pmod 5,$ so that $n \equiv 1,2,3 \pmod 5.$ Both $2^2 + 1 \equiv 3^2 + 1 \equiv 0 \pmod 5,$ so the $n^2 + 1$ factor takes care of 2,3. The $n-1$ factor takes care of $1 \pmod 5$