How this instrument works
A Pythagorean triple is a set of three positive integers a, b, and c that satisfy a² + b² = c² exactly — 3-4-5 is the smallest, but there are infinitely many more. Euclid gave a way to manufacture them on demand: choose any two positive whole numbers m and n with m greater than n, then set a = m² − n², b = 2mn, and c = m² + n². Feed in a pair, and out comes a genuine right-triangle triple, no searching required.
The guarantee is algebraic, not empirical. Expand (m² − n²)² + (2mn)² and the cross terms cancel into m⁴ + 2m²n² + n⁴, which is precisely (m² + n²)² once you factor it back — the same expression as c² squared out. Because that identity holds for every m and n, the triple it produces satisfies the Pythagorean relation by construction, the way a well-cut key fits its lock by design rather than chance. Euclid recorded this construction in the Elements roughly twenty-three centuries ago, tucked into the number-theory books rather than the geometry everyone remembers him for.
One condition does real work here: m must exceed n, and both must be positive, or a = m² − n² turns zero or negative and the 'triangle' collapses before it starts. A second, subtler fact rewards the curious: restricting m and n to coprime values of opposite parity — one even, one odd — produces only primitive triples, ones with no common factor running through all three sides. Every other triple, such as 6-8-10, is just a primitive one scaled up, so this single formula reaches the entire family, not a sampling of it.
- Enter whole numbers for m and n, keeping m larger than n and both greater than zero — start with m = 2 and n = 1.
- Read a, the first leg, calculated as m² − n².
- Read b, the second leg, calculated as 2mn.
- Read c, the hypotenuse, calculated as m² + n² — always the largest of the three outputs.
- Try a new pair, such as m = 3 and n = 2, to generate the next triple in the family and watch every value stay a whole number.
Worked example — generating 3-4-5 from m = 2, n = 1
Set m = 2 and n = 1, the smallest pair the formula allows. Then a = 2² − 1² = 4 − 1 = 3, b = 2 × 2 × 1 = 4, and c = 2² + 1² = 4 + 1 = 5. Checking the result: 3² + 4² = 9 + 16 = 25, and 5² = 25 as well — the identity holds exactly, and (3, 4, 5) is the smallest Pythagorean triple in existence.
Step to the next pair and the pattern keeps producing exact integers: m = 3, n = 2 gives a = 9 − 4 = 5, b = 2 × 3 × 2 = 12, and c = 9 + 4 = 13, the well-known 5-12-13 triple, again satisfying 5² + 12² = 25 + 144 = 169 = 13² exactly. No pair of valid inputs has ever broken this pattern, because none can — the algebra makes it impossible.
Questions
What is Euclid's formula for generating Pythagorean triples?
Choose any two positive whole numbers m and n with m greater than n, then compute a = m² − n², b = 2mn, and c = m² + n². Euclid recorded this generator in the Elements around 300 BCE, and it returns integers satisfying a² + b² = c² for every valid pair — not through search, but because the algebra forces the result.
Why does the formula always satisfy a² + b² = c²?
Expand both squared legs: (m² − n²)² + (2mn)² equals m⁴ − 2m²n² + n⁴ plus 4m²n², which simplifies to m⁴ + 2m²n² + n⁴. That sum factors neatly into (m² + n²)², which is exactly c² squared — so the equality is a plain algebraic identity, true for every m and n rather than something that merely happens to check out.
What happens if n is greater than or equal to m?
The leg a = m² − n² turns zero or negative, which cannot be a real triangle side. The instrument requires m greater than n, both positive, for exactly this reason — swap the two values or set them equal and b and c still compute, but the geometry underneath has already broken.
What makes a Pythagorean triple primitive?
A primitive triple has no factor common to all three sides, like 3-4-5 or 5-12-13. Choosing m and n coprime and of opposite parity — one even, one odd — always yields a primitive triple. Every non-primitive triple, such as 6-8-10, is just a primitive one multiplied through by a whole number, so nothing is left out.
How does this differ from a calculator that solves the Pythagorean theorem?
A Pythagorean theorem calculator finds a missing side once two sides of a right triangle are already measured. This instrument runs the opposite direction: it builds an entirely new integer right triangle from two seed numbers, m and n, rather than completing one that already exists.
Does every Pythagorean triple come from this formula?
Yes. Every primitive triple traces back to exactly one pair of coprime, opposite-parity positive integers m and n, a result proved rigorously after Euclid's time. Every non-primitive triple is a whole-number multiple of some primitive one, so scaling the output reaches the rest — the formula's coverage is complete.