First we generate a formula for all Primitive Pythagorean Triples. A Primitive Pythagorean Triple (PPT) is a triple of integers p, q, r for which p 2 q 2 r 2 and the highest common factor of p, q and r is 1, i.e. hcf p, q, r 1 r p q Since p 2 q 2 r 2 , any factor of two of these numbers is automatically a factor of the third. Therefore, in any PPT, the highest common factor of any two of the numbers is 1. ---------------------------It is easy to see, with a little algebra, that for any integers m, n the triple m 2 n 2 , 2mn, m 2 n 2 is a Pythagorean triple: m 2 n 2 2mn m 2 n 2 2 2 2 We now prove that every PPT can be written in this form. Starting with p 2 q 2 r 2 , first notice that p and q cannot both be even, as otherwise hcf p, q, r 2 , and they cannot both be odd because 2k 1 2l 1 2 2 is 2 more than a multiple of 4 and this cannot be equal to r 2 since all squares are of the form 4n or 4n 1 . Therefore one of p and q is even and the other is odd (and r is odd). Let’s say q is even. Then q can be replaced by 2u and p 2 q 2 r 2 can then be written 2u r 2 p 2 or, equivalently, 4u 2 r p r p 2 Since both r and p are odd then r p and r p are both even. Let r p 2 x and r p 2 y . Substituting in 4u 2 r p r p gives u 2 xy . The simultaneous equations r p 2 x and r p 2 y give r y x and p y x. We have already established that hcf r , p 1 . If x and y shared a common factor greater than 1 then r y x and p y x would also share this common factor. Consequently, hcf r , p 1 implies that hcf x, y 1 . But the product of x and y is a square: u 2 xy . Since hcf x, y 1 , both x and y must themselves be squares since neither can pick up a matching factor from the other. With x n 2 and y m 2 we have: q 2u 2 xy 2mn p y x m2 n2 r y x m2 n2 Proof complete. Finally, to generate all PPTs we need m n (so that x 0 ); hcf m, n 1 (so that hcf p, r 1 ); one of m and n is even and the other odd (to ensure p and r are both odd) . Back to the maths Item of the Month for June 2007 Let the two Pythagorean triples be m 2 n2 m 2 n2 p 2 p q2 2mn 2 q2 2 pq Then the product of the largest values is m n p and also m n p 2 2 2 q 2 mp nq np mq 2 2 2 q 2 mq np mp nq 2 2 2 2 in the example given in the problem, we have m 2, n 1 to generate the triple 3, 4,5 and p 3, q 2 to generate the triple 5,12,13 . Using these values we have 5 13 82 12 7 2 42 Note that this is only guaranteed to work for primitive Pythagorean triples. For example with the triples 9,12,15 which is not primitive and 5,12,13 you will find that 13 15 195 cannot be written as the sum of two squares in even one way never mind two.