<s>[INST] Primes congruent to 1 mod 6 I came across a claim that I found interesting, but can't seem to prove for some reason. I have the feeling it should be easy
a prime $p$ can be written in the form $p = a^2 -ab +b^2$ for some $a,b\in\mathbb{Z}$ if and only if $p\equiv 1\bmod{6}$
 [/INST] If $(a,b)=d,d^2\mid (a^2-ab+b^2)$
If $d>1,a^2-ab+b^2$ can not be prime $\implies d=1$
Now, if prime $p=a^2-ab+b^2\implies p\mid (a+b)(a^2-ab+b^2)\implies p\mid (a^3+b^3)$
So, $$a^3\equiv(-b)^3\pmod p\implies \left(-\frac ab\right)^3\equiv 1\pmod p\implies ord_p \left(-\frac ab\right)\mid 3$$
If $ord_p \left(-\frac ab\right)=1,p(=a^2-ab+b^2)\mid (a+b)$
If $(a^2-ab+b^2)\mid(a+b),(a^2-ab+b^2)\mid(a+b)^2$
$\implies (a^2-ab+b^2)\mid 3ab$
$\implies (a^2-ab+b^2)\mid 3$ as $(a^2-ab+b^2,a)=(b^2,a)=1$ as $(a,b)=1$
But, $a^2-ab+b^2>3,$  for $a,b>2$ 
$$\implies ord_p \left(-\frac ab\right)= 3\implies 3\mid \phi(p)\implies p\equiv1\pmod 3\equiv1,4\pmod 6$$
Hence, $p\equiv1\pmod 6$  as $p\equiv4\pmod 6$ is even and $p>2$
</s>