Pythagorean triples

Pythagorean triples consists of three positive integers a, b, and c, such that a2 + b2 = c2. These triples are commonly written as (a, b, c), and a typical example is (3, 4, 5); 32 + 42 = 52 or 9 + 16 = 25. A primitive Pythagorean triple is one in which a, b and c are coprime (gcd(a, b, c) = 1) and for any primitive Pythagorean triple, (ka, kb, kc) for any positive integer k is a non-primitive Pythagorean triple. Euclid's formula (300 BC) will generate Pythagorean triples given an arbitrary pair of positive integers m and n with m > n > 0. A primitive Pythagorean triple additionally require:
a=m^2-n^2, b=2mn \mbox{ and } c=m^2+n^2
It's easy to check algebraically that the sum of the squares of the first two is the same as the square of the last one. Below is a table of [a, b, c] for n between 1 and 9 and m between 2 and 10. The highlighted cells show primitive Pythagorean triples (GCD(a, b, c) = 1).
n =123456789
m ↓
Euclid of AlexandriaEuclid of Alexandria was one of the most prominent mathematicians of antiquity best known for his treatise on mathematics, The Elements.