1 Pythagorean Quadruples 1. Pythagorean and Primitive Pythagorean Quadruples A few years ago, I became interested with those 3 vectors with integer coordinates and integer length or norm. The simplest example is the vector 2i + 2 j + k whose length is 3. A couple of other elementary examples include 2i + 6 j + 3k of norm 7 and 3i + 4 j +12k of norm 13. Of course these integer friendly vectors generalizes Pythagorean triples: An ordered 4-tuple of positive integers ( a,b,c,d ) is a Pythagorean Quadruple (PQ) if a 2 + b 2 + c 2 = d 2. This quadruple is primitive (PPQ) provided that gcd(a,b,c,d) =1. It is easy to see that a PQ is a multiple of PPQ and a PQ (a,b,c,d) is a PPQ if the gcd of any three of these positive integers is 1, in particular if gcd(a,b,c) = 1. In this article I would like to share my discovery of a formula that generates all PPQ s. It should be noted that in the 18th and 19th centuries several formulas were discovered to generate PQ s; however, most of them did not generate all PQ s or PPQ s. The first step I took to discover a formula for PPQ s was to examine Euclid's Theorem on Primitive Pythagorean Triples: The Primitive Pythagorean Triple Theorem Let a, b and c be positive integers such that a 2 + b 2 = c 2. Also assume that gcd(a,b,c) = 1. Then c is odd and either a or b is odd (but not both; say, b is odd and a is even). Then there exist relatively prime positive integers u and v of opposite parity, with u > v, such that:, and. Furthermore, all such triples (a,b,c) described above are Primitive Pythagorean Triples as well.
2 This theorem deserves a few observations: 1. There is a parity condition on the generators u and v. (Another way to express "u and v have opposite parity" is to write "u+v is odd.") 2. The Pythagorean triple itself enjoys a couple of parity conditions: c is odd and a+b is also odd. 3. We also have an algebraic identity: ; i.e., this equation is true regardless of any conditions placed on u and v. The first step I took in my search for a formula was to see if PPQ s had any parity conditions. To this end, I examined a few PPQ's : (1,2,2,3), (2,3,6,7), (3,4,12,13). It appears that d is always odd, one of a, b or c is also odd and the other two are even. This observation turns out to be true and is easily proved using mod 4 arithmetic. The Parity Lemma for PPQ's Let be a PPQ. Then d is odd, and exactly one of a, b or c is odd as well. I will now adopt the convention whenever is a PPQ, then a and b are even and c and (of course) d are odd. The next step was to find an algebraic identity that would generate (not necessarily primitive) PQ s. The following is an "obvious" and wellknown generalization of the Pythagorean Triple identity: Let u, v, w be positive integers, u 2 +w 2 > v 2. Now suppose that and. Then is a PQ.
3 It should be clear that a necessary condition for this PQ to be primitive is that gcd(u,v,w) = 1. (We might also conjecture a parity condition, namely, u+v+w is odd.) We will now collect some data using this identity and make some observations concerning the gcd = gcd(a,b,c,d). u w v a b c d gcd 1) ) ) ) ) ) ) This table demonstrates that the two conditions, gcd(u,v,w) = 1 and u+v+w is odd, are not sufficient to guarantee that (u,v,w) generates a PPQ. Indeed, there do not exist integer generators for the primitive parents of the PQ's listed in (3), (4) and (5). (The primitive parents of (3), (4) and (5) are,
4 respectively, (4,28,35,45), (20,160,73,177) and (24,68,45,95)). It appears that we need to include a divisor along with our generators to insure ourselves of a PPQ. We now come to the task of relating the gcd to its generators. At this point, it is difficult to motivate how one would discover the relationship. It suffices to say that after staring at these examples for several days and a long walk I discovered that: gcd(a,b,c,d) = gcd(u 2 + w 2, v). In our examples (3), (4) and (5) we have: gcd(20,140,175,225) = 5 = gcd(200,5) = gcd( , 5) gcd(260,2080,949,2301) =13 = gcd(1625,26) = gcd( ,26) gcd(120,240,225,425) = 5 = gcd(325,10) = gcd( ,10). Note that we do not have gcd(a,b,c,d) = gcd(u 2 + w 2, v 2 ), as illustrated in example (5): gcd( ,10 2 ) = gcd(325,100) =25. Finally, we need to find a parity condition for the generators. To do this, we will examine examples (6) and (7). Both of these PQ's, (12,4,6,14) and (6,4,12,14), are essentially the same. However, in example (7) we see that: gcd(u 2 + w 2, v) = gcd(13,1) = 1 2 =gcd(12,4,6,14). On the other hand, example (6) does satisfy the gcd conjecture: gcd(u 2 + w 2, v) = gcd(10,2) = 2 = gcd(12,4,6,14). Furthermore, the primitive parent of example (6), (6,2,3,7), satisfies our parity convention for PPQ's (a and b are even, c and d are odd). The primitive parent of example (7), (3,2,6,7), does not satisfy our parity convention. The important feature to notice here, in example (7), is that: v = 1 is odd and u+w = 5 is also odd (i.e., not even). Looking at other examples where v is odd we see that in examples (1), (2) and (3) that u+w is even. In the examples where v is even, it does not matter whether u+w is even or odd;
5 each of these examples does satisfy our gcd conjecture and their primitive parents satisfy our parity convention. We can now state our parity condition for the generators (u,v,w) as follows: If v is odd, then u+w is even. 2. The Primitive Pythagorean Quadruple Theorems We are now in a position to state and prove the Primitive Pythagorean Quadruple Theorem. Actually, we will accomplish this via two theorems: (I) The Verification Theorem. All generators (u,v,w), gcd(u,v,w) =1, satisfying the parity condition together with the divisor g will provide us with a Primitive Pythagorean Quadruple. (II) The Generator Theorem. Every PPQ has generators (u,v,w), gcd(u,v,w) = 1, satisfying the parity condition and a divisor g. As you are about to see, the proof of the Verification Theorem is not nearly as simple and straightforward as it is in the verification for Primitive Pythagorean Triples. The Verification Theorem Let u, v, w be positive integers,, and let g = gcd(u 2 + w 2, v). Suppose that: (i) gcd(u,v,w) = 1. (ii) If v is odd, then u+w is even. (iii) a = 2uv/g, b = 2wv/g, c = (u 2 + w 2 - v 2 )/g and d = (u 2 + w 2 + v 2 )/g. Then (a,b,c,d) is a PPQ with a and b even and c and d odd. Proof. A simple computation shows that (a,b,c,d) is a PQ. We will now show that a and b are even. Since g divides v, (v/g) is a positive integer. Therefore, a = 2u(v/g) and b = 2w(v/g) are even. Next, we demonstrate that d is odd. There are three cases to consider.
6 case(i) Suppose that v is odd. Then u 2 + w 2 is even since u+w is even. Hence, dg = u 2 + w 2 + v 2 is odd. This implies that d is odd. case(ii) Suppose that v is even and u + w is also even. Then u and w are both odd since gcd(u,v,w) = 1. Thus, dg = u 2 + w 2 + v 2 2(mod 4). Note that g is even since v and u 2 + w 2 are both even. If d were even, then dg would be a multiple of 4, contradicting the above congruence. Hence, d must be odd. case(iii) Suppose that v is even and u+w is odd. Then u 2 + w 2 is odd. Therefore, dg = u 2 + w 2 + v 2 1(mod 2) and d must be odd in this case as well. It now follows that c is odd since is odd. Our final task is to prove that our PQ is primitive. As is typical in these situations, we shall assume otherwise and then derive some sort of contradiction. If (a,b,c,d) were not primitive, then there would be a prime p that divides each of a, b, c and d. ( Note that p is odd since p divides d and d is odd.) Clearly, p divides each of 2uv, 2wv, and since 2uv = ag, 2wv = bg, u 2 + w 2 v 2 = cg and u 2 + w 2 + v 2 = dg. Therefore p divides dg cg = 2v 2. Consequently p divides v. Similarly p divides u 2 + w 2. Hence p divides g because g = gcd(u 2 + w 2,v). Since gcd(u,v,w) = 1 and p divides v, either p does not divide u or p does not divide w; let us suppose that p does not divide u. Now p divides a and p divides g implies that p 2 divides ag, i.e., p 2 divides 2uv. Hence, p 2 divides v. Also, p divides g and p divides d implies that p 2 divides dg, i.e., p 2 divides u 2 + w 2 + v 2. We now have p 2 dividing both v and u2 + w2 + v2, thus p2 divides u2 + w2. Hence p2 divides g. Repeating this argument and using mathematical induction, we conclude that p n divides
7 v and g for all positive integers n. This is absurd. The proof of the verification theorem is now complete. We now come to the vexing task of when given a PPQ (a,b,c,d), how do we find its generators (u,v,w) and its divisor g? Working backwards, we can solve for (the squares) of u, w and v:, and. The important feature to observe here is that g times each of the expressions,, is a (perfect) square. There is an abundance of positive integers with this property, e.g., the number has this property. Our divisor g has to be large enough in order to provide us with squares and yet small enough to divide 2uv, 2wv, and. Perhaps the smallest positive integer times each of, which produces squares, is the number "g" we seek. The Generator Theorem Let (a,b,c,d) be a PPQ. Then there exists positive integers u, v and w, u2 + w 2 > v 2, and a positive integer g such that: (i) a = 2uv/g, b = 2wv/g, c = and d =. (ii) gcd(u,v,w) = 1 (iii) If v is odd, then is also odd. Proof. Let S be the set of all positive integers x such that: and are all squares. Note that S is nonempty since
8 is a member of S. By the Well Ordering Principle, S has a smallest member, say g. We now define:, and. A straightforward computation demonstrates that (i) holds. We now show that (ii) holds as well, i.e., gcd(u,v,w) = 1. Otherwise there would be a prime p such that p divides each of u, v and w (thus, u/p, v/p and w/p are all positive integers). Therefore, p 2 divides the integers ag, bg and cg since ag = 2uv, bg = 2wv and cg = u 2 + w 2 v 2. By virtue of the gcd(a,b,c) = 1, p does not divide a or p does not divide b or p does not divide c. Hence p 2 divides g, say g/p 2 = h ε Z +. Note that h < g. We now have: This is a contradiction since g was chosen as the smallest positive integer with this property. This proves (ii). To prove (iii) note that g divides since =. (Recall that d and c are both odd, thus is an integer.) We will now assume that v is odd. Hence g is odd and therefore gd and v 2 are odd as well. Since u 2 + w 2 + v 2 = gd,. Thus,, i.e., is even. This completes the proof of the Generator Theorem.
9 3. Generalizations Is our PPQ formula a generalization of the Primitive Pythagorean Triple formula? Certainly, the algebraic identity that we used to generate PQ's is a generalization of the PT identity. Indeed, if we set w = 0 we obtain: a = 2uv/g, b = 0, c = (u 2 v 2 )/g and d = (u 2 + v 2 )/g. We can now easily show in this case that: (i) gcd(u,v) = 1, (ii) g=1 and (iii) u and v have opposite parity. (i) 1 = gcd(u,v,0) = gcd(u,v). (ii) 1 = gcd(u,v) = gcd(u 2, v) = gcd(u , v) = g. (iii) There are two cases here: v is even or v is odd. If v is even, then u must be odd since gcd(u,v) = 1. On the other hand, if v is odd, then u+w = u+0 =u is even. At this point it would be tempting to generalize the PPQ formula to higher order Pythagorean n-tuples. However, the situation for (Primitive) Pythagorean Quintuples and above is a little murky and offers its own surprises. The natural generalization for the Quintuple case would be: Let x, y, z, v be positive integers and let g=gcd(x 2 +y 2 +z 2,v). Suppose that : (i) gcd(x,y,z,v) = 1 (ii) If v is odd, then x+y+z is even (iii) a=2xv/g, b=2yv/g, c=2zv/g, d=(x 2 +y 2 +z 2 v 2 )/g and e=(x 2 +y 2 +z 2 +v 2 )/g. Then (a,b,c,d,e) is a Primitive Pythagorean Quintuple. This statement is indeed true and its proof is very similar to the Verification Theorem. For example, the generator (2,1,1,1) generates the Primitive Pythagorean Quintuple (4,2,2,5,7). However, not every Primitive Pythagorean
10 Quintuple can be generated by the above formula; for example, consider (a,b,c,d,e) = (1,1,1,1,2). Part of the problem here is that in our formula, e is always odd. This difficulty should have been anticipated since every positive integer is the sum of four (or fewer) positive squares. In particular, Primitive Pythagorean Quintuples do not enjoy a parity condition that is similar to Pythagorean Triples and Quadruples. The situation here is not hopeless; there is another algebraic identity that we may employ: (xv) 2 + (yv) 2 + (zv) 2 + [(x 2 +y 2 +z 2 v 2 )/2] 2 = [(x 2 +y 2 +z 2 +v 2 )/2] 2. For example, if we use (x,y,z,v)=(1,1,1,1), then the above formula would generate the Pythagorean Quintuple (1,1,1,1,2). We can illustrate this formula with another example: (4,2,1,1) generates (4,2,1,10,11). This Pythagorean Quintuple can, essentially, be generated by our "Quintuple Conjecture" stated earlier: (2,1,5,5) generates (4,2,10,1,11). Uniqueness of the generators can be preserved if we separate e into two cases: even or odd. The proof of the following theorem, its converse and any further generalizations is left to the enjoyment of the reader. The Pythagorean Quintuple Theorem. Let (a,b,c,d,e) be a Primitive Pythagorean Quintuple. Then there exists positive integers x,y, z and v, x 2 +y 2 +z 2 > v 2, and a positive integer g such that: (I) When e is odd (i) gcd(x,y,z,v) = 1. (ii) If v is odd, then x+y+z is even. (iii) a=2xv/g, b=2yv/g, c=2zv/g, d=(x 2 +y 2 +z 2 v 2 )/g and e=(x 2 +y 2 +z 2 +v 2 )/g. (II) When e is even (i) gcd(x,y,z,v) = 1
11 (ii) x, y,z and v are all odd (iii) a=xv/g, b=yv/g, c=zv/g, d=(x 2 +y 2 +z 2 v 2 )/(2g) and e=(x 2 +y 2 +z 2 +v 2 )/(2g). It should come as no surprise that in the converse of this theorem g = gcd(x 2 +y 2 +z 2,v). 4. A Little History The problem of finding a formula that will generate Pythagorean Quadruples has been around for over 200 years. In this section I have selected a few of these formulas that can be found in Dickson's  History of the Theory Numbers vol. II, chapter VII . 1. Matsunago (Japan, c. 1740). Take your favorite pair of positive integers a and b, and then factor a 2 + b 2 = mn, where m > n, m+n even. Now let c = (m n)/2 and d = (m + n)/2. Then (a,b,c,d) is a PQ. To illustrate, consider a = 3 and b = 6. Then, a 2 + b 2 = 45 = 9 5. We now have the PQ (3,6,2,7). It should be noted that this method, although very simple, will not generate all PPQ's. For example the PPQ (2,28,35,45) cannot be generated using Matsunago s method. 2. H.S. Monck (Great Britain(?), 1878). Monck's algorithm is particularly amusing since you can generate a PQ from a given PQ: Given a PQ (a,b,c,d), not necessarily positive, let x=a+b+d, y=a+c+d, z=b+c+d and u=a+b+c+2d. Then (x,y,z,u) is another PQ. The example provided for us in Dickson is: From (1,-2,2,3) we obtain (2,3,6,7). 3. A. Desbouves (France, 1886)
12 Mr. Desbouves proved that all PQ's (not just PPQ's) (a,b,c,d) have the form: a=2(p 2 +q 2 s 2 ), b=2[(p s) 2 q 2 + (q s) 2 ], c = (q s) 2 p 2 + 4q(p s) 2 and d = 3[(p s) 2 + q 2 ] +2s(p q) 2. Amazing as this formula is, it is not clear how this formula generalizes the Pythagorean Triple formula. 4. In 1907 A. Hurwitz gave a somewhat complicated formula for the number of solutions (a,b,c) for the equation, a 2 + b 2 + c 2 = d 2, when d is given. 5. Another Problem A problem similar to finding Pythagorean Quadruples is the following: Does there exist a triple of positive integers (x,y,z) such that x 2 +y 2,x 2 +z 2 and y 2 +z 2 are all squares? The answer is, of course, yes. In 1719 Paul Halcke found one solution to be (44,240,117). There are several formulas to generate some of these triples, the simplest being the one offered to us by the 18th century (blind from infancy) mathematician N. Saunderson: Suppose that (a,b,c) is a Pythagorean Triple. Now let x=a(4b 2 c 2 ), y=b(4a 2 c 2 ) and z=4abc. For example, (3,4,5) generates (117,44,240). As in Pythagorean Triples and Quadruples these triples enjoy a geometrical interpretation as well: A triple of positive integers (x,y,z) with the above property corresponds to a rectangular parallelepiped of width x, length y and height z which has positive integer values for all its face diagonals. For other formulas and a short history of this problem please read chapter XIX, vol. II, PP , in Dickson. 6. The Last Problem What is meant here by "The Last Problem" is the final problem to be mentioned in this article. In the February, 1994 issue of FOCUS, Keith
13 Devlin in his monthly editorial offered the following as the next "Fermat Problem" (which he called the "Integer Brick" problem): "The problem asks if it is possible to construct a rectangular brick (i.e., a rectangular parallelepiped), all of whose diagonals (both face and cross-diagonals) are integers." Altogether this problem has seven parameters: the three dimensions, the three face diagonals and the inner or cross-diagonal. Partial solutions have been found for six of the seven parameters to be integer valued. One solution, known to Euler is (104,153,672). (Here, = 185 2, = and = ) For a discussion of these solutions the reader is invited to read problem D18 in Unsolved Problems in Number Theory, 2nd edition, by Richard K. Guy  or the John Leech article in the American Mathematical Monthly, vol. 84 (1977), pp . References 1. David M. Burton, Elementary Number Theory, 4th ed., McGraw-Hill, New York, James T. Cross, Primitive Pythagorean Triples of Gaussian Integers, Mathematics Magazine, 59:4(1986), Leonard E. Dickson, History of the Theory of Numbers, vol. II, Chelsea Publishing, New York, Ernest J. Eckert, The Group of Primitive Pythagorean Triangles, Mathematics Magazine, 57:1(1984), Richard K. Guy, Unsolved Problems in Number Theory, 2nd ed., Springer-Verlag, New York, 1994.
14 6. John Leech, The Rational Cubiod Revisited, American Mathematical Monthly, vol. 84 (1977),