<s>[INST] How can I prove/disprove that if n is an integer which is not divisible by 3, then $n^3+n^2+2n+1 ≡ 2 \pmod 3$? By doing a few examples, it seems as if the statement is true. However, I'm having trouble proving (or disproving) it. I know that the numerical value of some $N$ can be written as $n_{0}10^{0}+n_{1}10^{1}+n_{2}10^{2}+\dotsb$ and $10\equiv 1 \pmod{3}$, but this just shows the divisibility rule for $3$. Can I use this somehow?
 [/INST] You have to check every case:
$1)$ If $n\equiv0 \pmod 3 \to n^3+n^2+2n+1\equiv 1\pmod 3$
$2)$ If $n\equiv 1 \pmod 3 \to n^3+n^2+2n+1\equiv 1+1+2+1\equiv 2\pmod 3$
$3)$ If $n\equiv -1 \pmod 3 \to n^3+n^2+2n+1\equiv -1+1-2+1 \equiv 2\pmod 3$
So if you want $n^3+n^2+2n+1\equiv 2\pmod 3$ you  must have $n\equiv \pm 1 \pmod 3$
</s>