Find the integers a such that 5 divides $a^{3}+3 a+1$.
The condition rewrites as $a^{3}+3 a+1 \equiv 0(\bmod 5)$. By trying the 5 residues, we observe that the only solutions are the integers congruent to 1 and 2 modulo 5.