Structure of $x^2 + xy + y^2 = z^2$ integer quadratic form The pythagorean triples $x^2 + y^2 = z^2$ can be solved in integers using rational parameterization of solutions to $x^2 + y^2 = 1$.
It goes through $(1,0)$, then consider the line $y = -k (x - 1)$ so that $x^2 + k^2(x-1)^2 = 1$
We get $(1+ k^2 )x^2 - 2k^2 x + k^2 = 1$ or $x =  \frac{k^2-1}{k^2+1}$ and $y=\frac{-2k}{k^2+1}$ and $z=1$
Then set $k= m/n$, for $(x,y,z) = (k^2-1,2k,k^2+1)=(m^2-n^2,2mn,m^2+n^2)$

What happens for 60-degree angle triangles $x^2+xy+y^2 = z^2$ ?  We could look for rational solutions to
$x^2 + xy + y^2 = 1 $ and $(1,0)$ works again.  Intersect with the line $y= k (x-1)$ ... 
get integer solutions: $(m^2-n^2, -m^2+2mn, m^2 - m n + n^2)$  A similar derivation was obtained earlier on math.StackExchange

In the case of pythagorean triple we can build new solutions $(m^2-n^2,2mn,m^2+n^2)$ from old using the maps
$$ (m,n) \mapsto (2m-n,m) \text{ or } (2m+n,m) \text{ or } (m+2n,n)$$
Can I find something similar to the Pythagorean triple tree for this quadratic form, $x^2 + xy + y^2 = z^2$?

 A: Sure, you're just looking for generators of $O(f,\mathbb{Z})$, where $f(x,y,z)=x^2+xy+y^2-z^2$ is a quadratic form in 3 variables. Since $f$ is isotropic, this will be a non-uniform arithmetic fuchsian group, commensurable with $PSL_2(\mathbb{Z})$. One can start looking for generators by finding vectors $(x,y,z)\in \mathbb{Z}^3$ such that $f(x,y,z)=1, 2$. Reflections in such vectors will generate a reflective subgroup, which one can find by Vinberg's algorithm. If this subgroup is finite-index, then you'll have found something analogous to the Pythagorean triple generators. If not, then you'll have to look for some other generators. Usually, you can also include reflections in vectors of the form $f(x,y,z)=-1,-2$ as well, which give rotations of the hyperbolic plane $f(x,y,z)=-1$ up to $\pm 1$. If this group is reflective, then it will appear somewhere in Daniel Allcock's list.
A: Generally speaking, this equation has a lot of formulas for the solution. Because it is symmetrical.
Write the formula can someone come in handy. the equation:
$Y^2+aXY+X^2=Z^2$
Has a solution:
$X=as^2-2ps$
$Y=p^2-s^2$
$Z=p^2-aps+s^2$
more:
$X=(4a+3a^2)s^2-2(2+a)ps-p^2$
$Y=(a^3-8a-8)s^2+2(a^2-2)ps+ap^2$
$Z=(2a^3+a^2-8a-8)s^2+2(a^2-2)ps-p^2$
more:
$X=(a+4)p^2-2ps$
$Y=3p^2-4ps+s^2$
$Z=(2a+5)p^2-(a+4)ps+s^2$
more:
$X=8s^2-4ps$
$Y=p^2-(4-2a)ps+a(a-4)s^2$
$Z=-p^2+4ps+(a^2-8)s^2$
For the particular case: $Y^2+XY+X^2=Z^2$  You can draw more formulas.
$X=3s^2+2ps$
$Y=p^2+2ps$
$Z=p^2+3ps+3s^2$
more:
$X=3s^2+2ps-p^2$
$Y=p^2+2ps-3s^2$
$Z=p^2+3s^2$
In the equation:  $X^2+aXY+bY^2=Z^2$ there is always a solution and one of them is quite simple.
$X=s^2-bp^2$
$Y=ap^2+2ps$
$Z=bp^2+aps+s^2$
$p,s$ - integers asked us.
