Let $p$ be a prime of the form $3k+2$ that divides $a^2+ab+b^2$. Prove that $a,b$ are both divisible by $p$. [Solution verification] Problem:Let $p$ be a prime of the form $3k+2$ that divides $a^2+ab+b^2$ for some $a,b\in \mathbb{Z}$. Prove that $a,b$ are both divisible by $p$.
My Attempt: $a^2+ab+b^2\equiv 0 \pmod p\Rightarrow a^3\equiv b^3\pmod p\Rightarrow a^{3k}\equiv b^{3k}\pmod p.$
Next, observe that due to FLT we have $a^{3k+1}\equiv b^{3k+1}\pmod p.$ Now if $p\not|a$ and $p\not|b$, then $\gcd(a,p)=\gcd(b,p)=1.$ Therefore we can use can conclude that $$a^{\gcd(3k,3k+1)}\equiv b^{\gcd(3k,3k+1)}\pmod p\Rightarrow a\equiv b\pmod p.$$ Therefore $$a^2+ab+b^2\equiv 0 \pmod p\Rightarrow 3b^2\equiv 0\pmod p \text{ and } 3a^2\equiv 0\pmod p.$$  Which implies that  $p|3$ which is a contradiction. Hence Proved. 
I would like to know whether this proof is correct or not. I am unsure about the use of $\gcd$ in the exponent. Moreover, I acknowledge that this question has been asked before, but I've not seen any answer using this fact explicitly. The fact being: Let $\gcd(a,m)=\gcd(b,m)=1$, then if $a^{x}\equiv b^x\pmod m$ and $a^y\equiv b^y\pmod m\Rightarrow a^{\gcd(x,y)}\equiv b^{\gcd(x,y)}\pmod m.$
 A: Here's a correct different solution. If $p=3k+2$ is an odd prime, $p\mid a^2+ab+b^2$, where $a,b\in\mathbb Z$, then $$a^2+ab+b^2\equiv 0\pmod{p}$$
$$\stackrel{\cdot 4}\iff (a+2b)^2\equiv -3a^2\pmod{p}$$
$$\iff (2a+b)^2\equiv -3b^2\pmod{p}$$
For contradiction, let either $p\nmid a$ or $p\nmid b$. Then either
$$\left((a+2b)a^{-1}\right)^2\equiv -3\pmod{p}$$
or $$\left((2a+b)b^{-1}\right)^2\equiv -3\pmod{p}$$
In both cases $-3$ is a quadratic residue mod the odd prime $p=3k+2$, which contradicts Quadratic Reciprocity.
If $p=2$ and $2\mid a^2+ab+b^2$ for some $a,b\in\mathbb Z$, then either $a\equiv 0\pmod{2}$ or $a\equiv 1\pmod{2}$; in the first case $2\mid b^2$, i.e. $b\equiv 0\pmod{2}$, and in the second case $$a^2+ab+b^2\equiv 1+b+b^2\equiv 1+b+b$$
$$\equiv 1+2b\equiv 1\not\equiv 0\pmod{2}$$
A: Start with $a^3\equiv b^3\bmod p$.
If $p$ divides $b$, then $p$ divides $a$. 
If $p$ does not divide $b$, there is $c$ such that $bc \equiv 1 \bmod p$. Then $(ac)^3 \equiv 1 \bmod p$.
If $ac \not\equiv 1 \bmod p$, then the order of $ac \bmod p$ is $3$ and so $3$ divides $p-1$, which contradicts $p=3k+2$.
If $ac \equiv 1 \bmod p$, then $a \equiv b$ and $a^2+ab+b^2 \equiv 3b^2$. If this is a multiple of $p$, then $p=3$ because $p$ does not divide $b$, which contradicts $p=3k+2$.
