This may not come as a great surprise to anyone else, but I was mildly pleased to stumble on the fact (?) that if two integers are both the
sums of two squares, so is their product:
If
x = a2 + b2
and
y = c2 + d2
then
xy =
(a2 + b2)(c2 +d2)
=
a2(c2 + d2) + b2(c2
+d2) =
a2c2 + a2d2
+ b2c2 + b2d2 =
(ac + bd)2 + (ad - bc)2
and by a similar procedure we can show that
xy = (ac - bd)2 + (ad + bc)2
xy = (ac - bd)2 + (ad + bc)2
Thus xy is actually the sum of two pairs of squares, unless ad = bc or ac = bd.
Or so it seems to me.