9.5 Right Triangles with Whole-Number Sides

Some right triangles have every side a whole number, like 3, 4, 5. These are prized by builders, since a knotted rope laid out in such lengths produces a perfect right angle on the spot. In Sulba-Sutra Verse 1.13, Baudhayana names several such trios:

(3,4,5),\ (5,12,13),\ (8,15,17),\ (7,24,25),\ (12,35,37),\ (15,36,39).

Baudhayana Triples A trio (a, b, c) of positive integers satisfying a^2 + b^2 = c^2 is called a Baudhayana triple (also a Baudhayana–Pythagoras triple, or simply a Pythagorean triple). Each one gives the sides of a right triangle.

Math Talk List every Baudhayana triple with all numbers \le 20. You should turn up (3,4,5), (6,8,10), (9,12,15), (12,16,20), plus (5,12,13) and (8,15,17). Notice anything? The first four are all simply multiples of (3,4,5).

Scaling makes infinitely many triples

Is (30, 40, 50) a triple? Is (300, 400, 500)? Both are (3,4,5) blown up, and both check out. That hints at a general rule.

The Scaling Rule If (a, b, c) is a Baudhayana triple and k is any positive integer, then (ka, kb, kc) is also a Baudhayana triple. We call it a scaled version.

The proof is short and tidy. Since a^2 + b^2 = c^2, (ka)^2 + (kb)^2 = k^2a^2 + k^2b^2 = k^2(a^2 + b^2) = k^2c^2 = (kc)^2. So (ka, kb, kc) satisfies the equation as well. Because k ranges over every positive integer, there are infinitely many Baudhayana triples.

Primitive triples

A triple sharing no common factor above 1 is called primitive. So (3,4,5) is primitive, while (9,12,15) is not, it is 3 \times (3,4,5). Find every primitive triple and you can manufacture all the others by scaling.

Try This Is (5, 12, 13) primitive? Which other primitive triples have all numbers \le 20? (Watch for (8,15,17).) Generate 5 scaled versions of each primitive triple, are any of those scaled versions themselves primitive? (Never: scaling forces in a common factor.) If (a,b,c) is non-primitive with common factor f > 1, is \left(\tfrac{a}{f}, \tfrac{b}{f}, \tfrac{c}{f}\right) still a triple? Test it with (9,12,15) and f = 3.

Generating new primitive triples

Here is a neat way to manufacture triples, leaning on a fact you already own: the sum of the first n odd numbers is n^2. Writing the nth odd number as 2n - 1,

\underbrace{1 + 3 + 5 + \dots + (2n-3)}_{\text{first } (n-1) \text{ odd numbers } = (n-1)^2} + (2n-1) = n^2,

which rearranges into the compact identity

(n-1)^2 + (2n-1) = n^2.

Now the clever step: whenever that last odd number 2n-1 is itself a perfect square, we have a square plus a square equalling a square, a Baudhayana triple!

Worked Example

Build a triple from the odd square 9.

9 is a perfect square and odd: 9 = 2 \times 5 - 1, so it is the 5th odd number, giving n = 5. Substituting: (5-1)^2 + 9 = 5^2 \;\Rightarrow\; 4^2 + 3^2 = 5^2. Out comes the triple (3, 4, 5).

Build a triple from the odd square 25. Here 25 = 2 \times 13 - 1, so n = 13: (13-1)^2 + 25 = 13^2 \;\Rightarrow\; 12^2 + 5^2 = 13^2, yielding the triple (5, 12, 13).

A Triple-Generating Formula (Enrichment) There is a second, more powerful recipe, known since Euclid, that reaches every primitive triple, including the ones the odd-square trick misses. Pick any two positive integers m > n. Then a = m^2 - n^2, \qquad b = 2mn, \qquad c = m^2 + n^2 always form a Baudhayana triple, because (m^2-n^2)^2 + (2mn)^2 = m^4 + 2m^2n^2 + n^4 = (m^2+n^2)^2. For example, m=4, n=1 gives (15, 8, 17) and m=5, n=2 gives (21, 20, 29), both of which the odd-square method cannot produce. When m, n have no common factor and are not both odd, the result is primitive.

Figure it Out: Generating Triples

Practice

  1. Find 5 more Baudhayana triples using the odd-square idea.
  2. Does the odd-square method ever return a non-primitive triple? (Hint: one leg is always one less than the hypotenuse.)
  3. Are there primitive triples the odd-square method cannot reach? If so, give one, and show how the m, n formula above produces it.
  1. Use odd squares 49, 81, 121, 169, 225:
    • 49 = 2(25)-1, n=25: 24^2 + 7^2 = 25^2(7, 24, 25).
    • 81 = 2(41)-1, n=41: 40^2 + 9^2 = 41^2(9, 40, 41).
    • 121 = 2(61)-1, n=61: 60^2 + 11^2 = 61^2(11, 60, 61).
    • 169 = 2(85)-1, n=85: 84^2 + 13^2 = 85^2(13, 84, 85).
    • 225 = 2(113)-1, n=113: 112^2 + 15^2 = 113^2(15, 112, 113).
  2. No, every triple from this method is primitive. The hypotenuse c = n and the larger leg n-1 differ by exactly 1, so they share no common factor, which forces the whole triple to be primitive.
  3. Yes. The odd-square method always gives a triple whose hypotenuse and a leg differ by 1. A triple like (8, 15, 17) (here 17 - 15 = 2) is out of reach. But the m, n formula delivers it: m=4, n=1 gives a = 16-1 = 15, b = 2(4)(1) = 8, c = 16+1 = 17, i.e. (8, 15, 17).
Baudhayana-Triple Checker

Enter three positive integers. We check whether a² + b² = c² and whether the triple is primitive.