Consider a triple of nonnegative integers $(a, b, c)$ such that $c^2 = a^2 + b^2$. This can be viewed as integer triangles with sides $(a, b, c)$ such that $c$ is the side opposite a $90°$ angle. Such triples are well-known as Pythagorean triples, and it is well-known (called Euclid's formula on Wikipedia) that all such primitive (i.e. $\gcd(a, b, c) = 1$) triples can be parametrized as:
\begin{align} a &= m^2 - n^2 \cr b &= 2mn \cr c &= m^2 + n^2 \end{align}
I've always found it mildly amusing (and occasionally confusing) that we started trying to find a parametrization for triples where $c^2$ was a sum of two squares, and obtained a parametrization where $c$ itself is a sum of two squares, i.e. has the same form.
Today I encountered the problem of nonnegative triples $(a, b, c)$ such that $c^2 = a^2 + b^2 + ab$. This can be viewed as integer triangles with sides $(a, b, c)$ such that $c$ is the side opposite a $120°$ angle. Such triples are called 1-Pythagorean triples on OEIS, Eisenstein triples in this paper, and “Trythagorean” triples in this blog post. Whatever the name, it turns out that all such primitive triples can be parametrized (see this very nice page) as:
\begin{align} a &= n^2 - m^2 \cr b &= m^2 + 2mn \cr c &= m^2 + mn + n^2 \end{align}
where $m < n$ such that $\gcd(m,n)=1$ and $m≢n \pmod 3$.
This is spooky: we looked for triples such that $c^2$ was of the form $a^2 + ab + b^2$, and it turns out that $c$ itself is of a similar form, $c = m^2 + mn + n^2$.
Question: Is this just a coincidence? If not, what's going on? What's the most general kind of problem for which this (whatever “this” is) is true?
There's a general method for homogeneous Diophantine equations of degree two, but I haven't yet tried other equations. Also, even when sometimes the form seems different, it is not really, for example, the same page parametrizes solutions to $c^2 = a^2 + b^2 - ab$ (corresponding to $60°$ angles) as $c = m^2 + n^2 + mn$ which would seem to be a counterexample, but replacing either $m$ with $-m$ or $n$ with $-n$ gives $m^2 + n^2 - mn$ so I'm not sure.