Inspired by this question on Mathematica StackExchange:
Consider the set of integer solutions $x, y \in \mathbb{Z}$ to the equation $x^2 + xy + y^2 = m$, for $m \in \mathbb{N}$. Conjecture: the number of distinct solutions to this equation is divisible by 6 for all integer $m$.
I have done a brute-force calculation in Mathematica for $m \leq 10^4$, and have not found any counterexamples. For example, there are:
- 0 integer solutions for $m = 2$;
- 6 distinct solutions for $m = 3$ [$(x,y) = \pm (2, -1)$, $(x,y) = \pm (-1, 2)$, and $(x,y) = \pm (1, 1)$];
- 12 distinct solutions for $m = 7$;
- 18 distinct solutions for $m = 49$;
and so forth. The largest number of solutions Mathematica found was 54 solutions, for $m = 8281$. All of these are divisible by 6.
Is there a counterexample to this conjecture for some larger value of $m$? Or can the conjecture be proven?
I suspect that a proof will involve some kind of hidden symmetry of the polynomial $x^2 + xy + y^2$ that maps integer solutions to integer solutions; but I haven't been able to nail it down. It's not hard to see that the number of solutions must be even (if $(x,y)$ is a solution, then so is $(-x, -y)$, and these are distinct unless $x = y = 0$); but the divisibility by 6 is much more mysterious to me.