Solve $a^2+b^2+c^2+d^2+2ab+2bc+2cd-2ca-2ad-2db=N^2$ I am looking for a characterization of the solutions of 
$$a^2+b^2+c^2+d^2+2ab+2bc+2cd-2ca-2ad-2db=N^2$$ in positive integers.
 A: In case you typed the thing correctly, it is integrally equivalent to $x^2 + 4yz.$ Setting this to zero is easy, setting it to a square not too bad. 
Alright, this is exactly the comment by Joffan, with $x = a+b-c-d$ and $y=b$ and $z=c.$
$$
\left( 
\begin{array}{rrrr}
1 & 0 &  0 & 0 \\
1 & 1 & 0 & 0 \\
-1 & 0 & 1 & 0 \\
-1 & 0 & 0 & 1 
\end{array}
\right)
\left( 
\begin{array}{rrrr}
1 & 0 &  0 & 0 \\
0 & 0 & 2 & 0 \\
0 & 2 & 0 & 0 \\
0 & 0 & 0 & 0 
\end{array}
\right)
\left( 
\begin{array}{rrrr}
1 & 1 &  -1 & -1 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 
\end{array}
\right) =
\left( 
\begin{array}{rrrr}
1 & 1 &  -1 & -1 \\
1 & 1 & 1 & -1 \\
-1 & 1 & 1 & 1 \\
-1 & -1 & 1 & 1 
\end{array}
\right)
$$ 
Remembered how to do this. Parametrization for $x^2 + 4yz = n^2$ by
$$   y = eg,   $$
$$ z = fg,  $$
$$ \frac{n+x}{2} = eh, $$
$$ \frac{n-x}{2} = fh. $$
To get something primitive, we need
$$ \gcd(e,f) = 1,  $$
$$ \gcd(g,h) = 1.   $$
A: I suppose that you mean
$$
a^2 + b^2+c^2+d^2 + 2ab - 2ac - 2ad - 2bc - 2bd +  2cd =N^2.
$$
Since the left hand side is $(a+b-c-d)^2$, we are done.
