$a^2+ab+b^2 \equiv 0 \pmod n$ if and only if $ a\equiv b\equiv 0 \pmod n$ Let $n$ be a prime number with $n \equiv -1 \mod 6$ and $a,b$ be positive integers. I want to prove:
 $$a^2+ab+b^2 \equiv 0 \mod n \iff  a\equiv b\equiv 0 \mod n$$

$a^2+ab+b^2\equiv0 \pmod n\to a^3-b^3\equiv0 \pmod n\to (ab')^3\equiv1\pmod n\to 3\mid n-1\; or\; a\equiv b \pmod 3$ where $b'$ is the inverse of $b$ $\pmod n$. Because $3\nmid n-1$ we have $a\equiv b \pmod n$ so we have $n\mid 3a^2$ we have $(n,3)=1$ so we have $n\mid a^2$ and $a\equiv 0 \pmod n$.
