Generating Pythagorean Triples
Which triples of whole numbers {a, b, c} satisfy a2 + b2 = c2 ?
You probably know {3, 4, 5} and {5, 12, 13}. But can you classify all possible Pythagorean triples?
Answer: it is possible to prove that all Pythagorean triples are of the form {M2 - N2,
2MN, M2 + N2} for some integers M and N, or they are multiples of this
form.
Thus setting M=2, N=1 gives {3,4,5} and M=3, N=2 gives {5,12,13}.
To generate one specific type of Pythagorean triples, you can follow
the following algorithm. It gives a triple where the
hypotenuse and the longer leg differ by 1.
- Pick an odd integer greater than one.
- Square it.
- Determine consecutive integers that have that sum.
You have generated a Pythagorean triple!
Here are some examples:
- Pick 3.
- Square it: 32 = 9.
- Determine consecutive integers that add up to 9: 4 and 5.
- The Pythagorean triple is 3, 4, 5 since 32 +
42 = 52
- Pick 9.
- Square it: 92 = 81.
- Determine consecutive integers that add up to 81: 40 and 41.
- The Pythagorean triple is 9, 40, 41 since 92 +
402 = 412
- Pick 11.
- Square it: 112 = 121.
- Determine consecutive integers that add up to 121: 60 and 61.
- The Pythagorean triple is 9, 60, 61 since 112 +
602 = 612