Recently, I came across the following solution to finding integer solutions for $z^2 = x^2 - xy + y^2$:
- $x = k(-n^2 -2mn)$
- $y = k(m^2 - n^2)$
- $z = k(mn + m^2 + n^2)$
I've been scratching my head trying to figure out how to derive this solution.
I initially thought that this was derived in the same way as the solution to the Pythagorean Triples based on:
$$(p^2 + q^2)^2 = (2pq)^2 + (p^2 - q^2)^2$$
So that, I get:
$(p^2 + q^2)^2 = z^2 + (2pq)(p^2 - q^2) = (2pq)^2 + (p^2 -q^2)^2$
But I don't see how to solve for $z$ based on the above.
Can anyone provide me the outline of how one figures out the general solution for $z^2 = x^2 -xy + y^2$?
Edit: Added clarification about solutions in integers