Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. A Pythagorean
quadruple is a tuple of integers a, b, c and d, such that d > 0 and
a2 + b2 + c2 = d2, and is often denoted (a,b,c,d). Geometrically, a
Pythagorean quadruple (a,b,c,d) defines a cuboid with side lengths |a|,
|b|, and |c|, whose space diagonal has integer length d. Pythagorean
quadruples are thus also called Pythagorean Boxes. All Pythagorean
quadruples (including non-primitives, and with repetition, though a, b
and c do not appear in all possible orders) can be generated from two
positive integers a, odd, and b, even, as follows: Let p be any factor
of a2 + b2, such that p2 < a2 + b2. Then c = (a2 + b2 ¿ p2) / 2 and d
= (a2 + b2 + p2) / 2. Note that |p| = sqrt{d - c}. A similar method
exists for a,b both even, with the further restriction that 2p must be
an even factor of a2 + b2. No such method exists if both a and b are
odd.