Can ANY pythagorean quadruple be generated using 4 integer variables $(m,n,p,q)$?
I've read up on Mordell's method, which uses a 3-variable system of generating pythagorean quadruples, and it is widely documented that this doesn't generate them all. However there is also another method which introduces a 4th parameter, q. What I've read suggests that all pythagorean quadruples can be generated if you include a 4th parameter - but is it the case that even this 4-parameter method doesn't generate them all?
From wikipedia the 4-variable equations are given as:
$a^2 + b^2 + c^2 = d^2$
where
$a = m^2 + n^2 - p^2 - q^2$
$b = 2(mq + np)$
$c = 2(nq - mp)$
$d = m^2 + n^2 + p^2 + q^2$
where $a$ is odd.
Consider the pythagorean quadruple $(a,b,c,d) = (3171,172,1620,3565)$.
Using (4) - (1), I infer $2(p^2 + q^2) = d - a = 3565 - 3171 = 394$
Therefore $p^2+q^2 = 197$ and the only possible values for p and q are $(p,q)=(28,195)$.
But then by expanding (2) and (3), we have either
$56m + 390n = 1620$
$56n - 390m = 172$
OR
$56m + 390n = 172$
$56n - 390m = 1620$
whichever way round I slice (2) and (3) there seems to be no integer solutions for $m$ and $n$.
So is it either the case that not all pythagorean quadruples have integer solutions of $m,n,p,q$ or have I made an error somewhere that I am not seeing?