Sum3Squares
I thought of extremely simple derivation of the parametrization of three squares which sum to square.
Suppose $a^2 + b^2 + c^2 = d^2$
then $a^2 + b^2 = d^2 - c^2$
As is well known, any number which is the sum of two squares is the product of only primes which are the sum of two squares.
We can thus easily derive from complex number arithmetic the parametrization of composite numbers which are the sum of two squares.
$(a_1 + i b_1)(a_1-i b_1)(a_2 + i b_2)(a_2 - i b_2) = (a_1 + i b_1)(a_2 + i b_2) (a_1 - i b_1) (a_2 - i b_2)$
$(a_1^2 + b_1^2) (a_2^2 + b_2^2) = ( (a_1 a_2 - b_1 b_2) + i (a_1 b_2 + b_1 a_2) )( (a_1 a_2 - b_1 b_2) - i (a_1 b_2 + b_1 a_2) )$
$(a_1^2 + b_1^2) (a_2^2 + b_2^2) = (a_1 a_2 - b_1 b_2)^2 + (a_1 b_2 + b_1 a_2)^2$
Also, since the product of two numbers is the difference of the squares of half their sum and half their difference,
$(a_1^2 + b_1^2)(a_2^2 + b_2^2) = ((a_1^2 + b_1^2 + a_2^2 + b_2^2)/2)^2 - ((a_1^2 + b_1^2 - a_2^2 -b_2^2)/2)^2$
Thus $(a_1 a_2 - b_1 b_2)^2 + (a_1 b_2 + b_1 a_2)^2 = ((a_1^2 + b_1^2 + a_2^2 + b_2^2)/2)^2 - ((a_1^2 + b_1^2 - a_2^2 -b_2^2)/2)^2$
$(a_1 a_2 - b_1 b_2)^2 + (a_1 b_2 + b_1 a_2)^2 + ((a_1^2 + b_1^2 - a_2^2 -b_2^2)/2)^2 = ((a_1^2 + b_1^2 + a_2^2 + b_2^2)/2)^2$
$(a_1 a_2 - b_1 b_2)^2 + (a_1 b_2 + b_1 a_2)^2$ not have remainder 2 when divided by 4.
That is why it is required that not both $(a_1 a_2 - b_1 b_2)$ and $(a_1 b_2 + b_1 a_2)$ be odd.
Kermit