I encountered this question in Number Theory by Naoki Sato.
Let a, b, and c be positive integers that are pairwise relatively prime, and that satisfy $a^2−ab+b^2=c^2$. Show that every prime factor of c is of the form $6k + 1$.
Attempt:
Since primes are either of the form $6k+1$ or $6k-1$, I tried to show $p \equiv 1 \pmod6$ by showing $p \equiv 1 \pmod2$ and $p \equiv 1 \pmod3$ but I am unable to show $p \equiv 1 \pmod3$.
Another direction I tried was to assume there exist a prime factor $p$ of $c$ with $p=6k-1$. By brute force I know that $a^2−ab+b^2 \equiv 0, 1, 3$, or $4 \pmod6$ but I can't see how to get a contradiction from here.
I am not sure how to use the condition that all 3 numbers are pairwise coprime.
Any help is much appreciated!
Here is a proof based on quadratic reciprocity.
Suppose $p=3k-1|a^2-ab+b^2$ with $a,b$ relatively prime. Neither $a$ nor $b$ can have zero residue $\bmod p$, else they both would which the hypothesis denies. Thus there exists a nonzero residue $r\equiv ab^{-1}\bmod p$ such that $r^2-r+1\equiv 0$. Multiplying by $4$ and completing the square gives $(2r-1)^2\equiv -3$. Therefore the Legendre symbol $(-3|p)=+1$ if $p$ is as assumed above.
But $(p|3)=(3k-1|3)=-1$ and $-3\equiv +1\bmod 4$, so QR forces the contradictory conclusion $(-3|p)=-1$.
The case $p=3$ remains and this is a bit tricky. There are multiples of $3$ having the form $a^2-ab+b^2$ where $a$ and $b$ are relatively prime. We just need $a\equiv -b\bmod 3$ because $a^2-ab+b^2\equiv (a+b)^2\bmod 3$. But, if $a\equiv -b\bmod 3$ with the common residue being $1$ or $2$, we find that $c^2\equiv 3\bmod 9$ which doesn't work.