Solve Diophantine equation with three variables part two I want to find all solutions of $$x^2+y^2+z^2-xy-yz-zx-x-y-z=0$$
Solutions need not to be primitive. I found several parametric family. For example
$(m^2, m^2+m , (m+1)^2)$
$(m^2, m^2+m+2 , (m+1)^2)$
$(m^2+1, m^2+m, (m+1)^2+1)$
$(m^2+1, m^2+m+4, (m+1)^2+1)$
$(m^2-m, m^2, (m+1)^2-(m+1))$
$(m^2-m, m^2+1, (m+1)^2-(m+1))$
$((m+2)^2-m, (m+2)^2, (m+3)^2-(m+1))$
$((m+2)^2-m, (m+2)^2+5, (m+3)^2-(m+1))$
$((m+2)^2+5, (m+2)^2+m+4, (m+3)^2+5)$
$((m+2)^2+5, (m+2)^2+m+12, (m+3)^2+5)$
$((m+3)^2-m+1, (m+3)^2+1, (m+4)^2-m)$
$((m+3)^2-m+1, (m+3)^2+8, (m+4)^2-m)$
$((m+4)^2+8, (m+4)^2+m+8, (m+5)^2+8)$
$((m+4)^2+8, (m+4)^2+m+18, (m+5)^2+8)$
$((m+3)^2+m+13, (m+5)^2+5, (m+4)^2+m+14)$
$((m+3)^2+m+13, (m+5)^2+16, (m+4)^2+m+14)$
I suspect I am missing something. These type of single-valued parametric solutions may exist in infinite numbers. Any help will be much appreciated.
 A: A bit of abstract theory makes the problem a lot simpler; homogenising the equation into
$$X^2+Y^2+Z^2-XY-YZ-ZX-XW-YW-ZW=0,$$
yields a homogeneous equation in four variables of degree $2$. This means it is a projective quadric surface in projective $3$-space, for which there is a standard method of parametrization if it is nondegenerate and nonempty:
Pick a point $p$ on the hypersurface; then every line through $p$ intersects the hypersurface in precisely two points (except the tangent line). Conversely every point on the surface of course defines a unique line through $p$, except the starting point itself.  In this way the points on the hypersurface are parametrized by the lines passing through $p$, which are in turn parametrized by the projective plane.
Luckily the given surface is nondegenerate and nonempty; it is defined by the matrix equation
$$[X,Y,Z,W]\left[\begin{matrix}2&-1&-1&-1\\-1&2&-1&-1\\-1&-1&2&-1\\-1&-1&-1&0\end{matrix}\right]\left[\begin{matrix}X\\Y\\Z\\W\end{matrix}\right]=0,$$
where the defining $4\times4$-matrix is routinely verified to be nonsingular, so the surface is nondegenerate. It is nonempty because we can easily find a point on it by inspection; for example
$$(X:Y:Z:W)=(0:0:0:1),$$
corresponding to $(x,y,z)=(0,0,0)$ for the original equation. So we can parametrize the surface as described above. But experience shows that the parametrization comes out much more nicely if we choose a point at infinity on the original surface, i.e. a point with $W=0$. One such point is
$$p:=(X:Y:Z:W)=(1:1:1:0),$$
and from here we can start the dirty work of finding an explicit parametrization.
The lines through the point $p$ are parametrized by $(\lambda:\mu:\nu)\in\Bbb{P}^2$ as follows:
$$L_{(\lambda:\mu:\nu)}:=\{(r+\lambda s:r+\mu s:r-(\lambda+\mu)s:\nu s):(r:s)\in\Bbb{P}^1\}.$$
Every such line intersects the original hypersurface in exactly two points; plugging the parametrization into the equation yields
\begin{eqnarray*}
(r+\lambda s)^2+(r+\mu s)^2+(r-(\lambda+\mu)s)^2&-&(r+\lambda s)(r+\mu s)-(r+\lambda s)(r-(\lambda+\mu)s)-(r-(\lambda+\mu)s)(r+\mu s)\\
&-&(r+\lambda s)(\nu s)-(r+\mu s)(\nu s)-(r-(\lambda+\mu)s)(\nu s)=0,
\end{eqnarray*}
and simplifying the mess above leaves us with
$$s(\nu r-(\lambda^2+\lambda\mu+\mu^2)s)=0,$$
yielding the nontrivial solutions
$$(r:s)=(\lambda^2+\lambda\mu+\mu^2:\nu),$$
corresponding to the intersection point
$$(X:Y:Z:W)=(\lambda^2+\lambda\mu+\mu^2+\lambda\nu:\lambda^2+\lambda\mu+\mu^2+\mu\nu:\lambda^2+\lambda\mu+\mu^2-\lambda\nu-\mu\nu:\nu^2).$$
By setting $\nu=1$ this reduces to the affine parametrization
$$(x,y,z)=(l^2+lm+m^2+l,l^2+lm+m^2+m,l^2+lm+m^2-l-m),$$
with parameters $l$ and $m$.
A: I was wrong about the formula... it looks like this....
$$X^2+Y^2+Z^2=XY+XZ+ZY+X+Y+Z$$
$$X=s(3(k^2-kt+t^2)s-k-t)$$
$$Y=s(3(k^2-kt+t^2)s+2k-t)$$
$$Z=s(3(k^2-kt+t^2)s-k+2t)$$
