# How to show that $a^2+a+1 \equiv 0 \pmod p$?

How to show that $a^2+a+1 \equiv 0 \pmod p$, where $p$ is an odd prime and $ord_p a=3$?

-

Hint: $a^3-1=(a-1)(a^2+a+1)$, so if $a^3\equiv 1$, then...