I was looking for integer solutions to this equation: $$a^2+b^2+c^2=6d^2$$ And found a parametric solution. Given u, v, w : $$a=(u-v)^2-2(u+w)^2+3w^2$$ $$b=(u-v)^2-2(v+w)^2+3w^2$$ $$c=(u-v)^2+(u+v-w)^2-3w^2$$ $$d=u^2+v^2+w^2$$
When will a parametric solution generate all possible solutions?
a^2 + b^2 + c^2 /. {a -> (u - v)^2 - 2 (u + w)^2 + 3 w^2,
b -> (u - v)^2 - 2 (v + w)^2 + 3 w^2,
c -> (u - v)^2 + (u + v - w)^2 - 3 w^2} // Factor
Mathematica Code
The quick way is to take quaternions with integer coefficients, say $$ q = w + x i + y j + z k, $$ with $$ i^2 = j^2 = k^2 = -1, $$ then $$ ij = k, jk = i, k i = j $$ in cyclic order, then $$ ji = -k, kj = -i, ik = -j. $$ Let's see, multiplication is associative. define $$ \bar q = w - xi - yj - zk. $$ Oh, the norm of $q$ is $$ q \bar q = w^2 + x^2 + y^2 + z^2 $$ Now, take, as a "vector" $$ u = 2 i + j + k $$ of norm $6.$ There should be 24 possible vectors of norm $6.$
Finally, let $$ d = q \bar q \; . \; $$ The cute part is that $$ v = \bar q u q = ai + bj + c k $$ is another vector, no real part, and $$ a^2 + b^2 + c^2 = 6 d^2 $$ This way, we can deal with $d \equiv 7 \pmod 8,$ which cannot be written as the sum of three integer squares.
See what you can do with it. Note that, when $$ \gcd(a,b,c,d) = 1, $$ first $d$ is odd, then $a,b,c$ cannot be divisible by $3.$
$$\color{magenta}{ a = ( w+x+z)^2 + ( -w + x + y)^2 - 3 y^2 - 3 z^2 } $$
$$\color{magenta}{ b = ( w + x - 2 z)^2 - 2 ( x-y-z)^2 + 3 ( y+z)^2 - 6 z^2 } $$
$$\color{magenta}{ c = ( w - x + 2 y)^2 - 2 ( x-y-z)^2 - 3 ( y-z)^2 + 6 z^2 } $$
$$\color{magenta}{ d = w^2 + x^2 + y^2 + z^2 } $$
More later....1:45 pm my time.
Programmed it; very repetitive, as usual. The first thing I did was do a raw search, $a^2 + b^2 + c^2 = 6 d^2,$ with $\gcd(a,b,c) = 1,$ finally $a \geq b \geq c \geq 0.$ In that list, there are just three ways to get $d=7,$ just six ways to get $d=15.$