# $p = a^{2} + ab +b^{2} \ a, b \in \mathbb{Z}$ [duplicate]

Let $p \neq 3$ be a prime. Prove that $p = a^{2} + ab +b^{2} \ a, b \in \mathbb{Z} \iff p \equiv 1 \ mod \ 3$.

The $\rightarrow$ direction is easy. For the other implication, I considered $\mathbb{K} = \mathbb{Q}[\sqrt{-3}] \$. Then $\mathbb{O}_{\mathbb{K}} = \mathbb{Z}[\frac{1+\sqrt{-3}}{2}] = \mathbb{Z}[\theta] \$ so for $\alpha = c +d\theta \in \mathbb{Z}[\theta]$ we have that $N_{\mathbb{K}|\mathbb{Q}}(\alpha) = c^{2}+cd+d^{2}$ and we can use the Kummer-Dedekind theorem.

The minimal polynomial of $\theta$ is $f(x) = x^{2}-x+1$ but how to do the reduction of $f(x) \ mod \ p$ ?