## Pythagorean Triples

Note: If your WWW browser cannot display special symbols, like ² or 2 or ±, then click here for the alternative Pythagorean Triples page.

The 3-4-5 right triangle (on the left) is famous. It is the smallest non-trivial (with sides greater than zero) right triangle with integer sides. By The Pythagorean Theorem, we know that 3²+4²=5² (9+16=25). These numbers are then the smallest Pythagorean triple: 3,4,5. Are there any others?

First, let's notice that we can double or triple (etc.) the 3-4-5 triangle. 6²+8²=10², 9²+12²=15², 12²+16²=20², etc. We could consider these triples to be uninteresting, as they are all the same triangle; the scale is just different. The other, interesting ones are called Primitive Pythagorean Triples.

A little experimentation shows that 5²+12²=13². And that too can be doubled, tripled, etc., as can all other, as yet undiscovered, triples. You may experiment for a while before you find the next primitive triple: 8²+15²=17².

How about a Pythagorean triple with two of the numbers being equal? Then x²+x²=z², or 2x²=z², or z=a sqr(2), where sqr() is the square root function. And we know that this equation has no integer solutions (Irrational Numbers).

It is well known that if you choose arbitrary positive integers m>n, that these equations generate all Pythagorean Triples (x, y, z):

x=m²-n², y=2mn, z=m²+n²

It is fairly easy to show that no matter what m and n are, x²+y²=z² (just show that x²+y² is the same number as z²). I won't show that this method generates ALL Pythagorean Triples. This method shows that there are infinitely many Pythagorean Triples. If we want just primitive triples, then m and n must be relatively prime, and one must be even while the other is odd. I won't prove that, either. Here are the first few values of m and n:

 m n x y z 2 1 3 4 5 3 1 8 6 10 3 2 5 12 13 4 1 15 8 17 4 2 12 16 20 4 3 7 24 25 5 1 24 10 26 5 2 21 20 29 5 3 16 30 34 5 4 9 40 41 6 1 35 12 37 6 2 32 24 40 6 3 27 36 45 6 4 20 48 52 6 5 11 60 61 7 1 48 14 50 7 2 45 28 53 7 3 40 42 58 7 4 33 56 65 7 5 24 70 74 7 6 13 84 85 ...

I notice that 3²+4²=5² and 5²+12²=13² have a hypotenuse one greater than one of the legs. We see from the above table that there other triples like that. Let's look at these triples in more detail:

x²+y²=(y+1)²=y²+2y+1
x²=2y+1
y=(x²-1)/2

We should be able to just plug in any odd number x and get a Pythagorean Triple:

 x y z 1 0 1 (trivial) 3 4 5 5 12 13 7 24 25 9 40 41 11 60 61 13 84 85 ...

This, of course, does not generate all triples. But there are infinitely many triples of this form.