Geometry

Pythagorean Triples: Formula, List and Examples

A Pythagorean triple is a set of three positive whole numbers (a,b,c)(a, b, c) that satisfy a2+b2=c2a^2 + b^2 = c^2, such as (3,4,5)(3, 4, 5). Euclid’s formula builds them from any whole numbers m>n>0m > n > 0: a=m2−n2a = m^2 - n^2, b=2mnb = 2mn, c=m2+n2c = m^2 + n^2.

a=m2−n2,  b=2mn,  c=m2+n2a = m^2 - n^2,\; b = 2mn,\; c = m^2 + n^2

Try it with your numbers

Show every step

The Pythagorean theorem holds for every right triangle, but a triple is the special case where all three sides come out as whole numbers with no decimals and no square roots. That is why textbooks, standardized tests and carpenters love them.

What are Pythagorean triples?

The theorem says the legs aa and bb and the hypotenuse cc of a right triangle obey a2+b2=c2a^2 + b^2 = c^2. Most right triangles break the “whole number” requirement: legs of 11 and 22 give c=5c = \sqrt{5}, which is a perfectly good right triangle and not a triple. A triple needs all three sides to be integers, and by convention cc is the largest.

Scaling is what makes triples multiply. If (a,b,c)(a, b, c) works, then (ka,kb,kc)(ka, kb, kc) works for any positive whole number kk, because

(ka)2+(kb)2=k2(a2+b2)=k2c2=(kc)2.(ka)^2 + (kb)^2 = k^2(a^2 + b^2) = k^2c^2 = (kc)^2.

Geometrically, you are building a larger similar triangle, so the angles stay the same and only the size changes.

A triple is primitive when its three numbers share no common factor beyond 11. (3,4,5)(3, 4, 5) is primitive and (6,8,10)(6, 8, 10) is not. Every triple is a primitive one multiplied by some kk, so the primitives are the real building blocks. Two details worth knowing: the numbers in a primitive triple are pairwise coprime (any two of them share no factor), and exactly one leg is even while the hypotenuse is odd.

List of common Pythagorean triples

There are exactly sixteen primitive triples with a hypotenuse of 100100 or less. Here they are, four per line:

  • (3,4,5)(3, 4, 5), (5,12,13)(5, 12, 13), (8,15,17)(8, 15, 17), (7,24,25)(7, 24, 25)
  • (20,21,29)(20, 21, 29), (12,35,37)(12, 35, 37), (9,40,41)(9, 40, 41), (28,45,53)(28, 45, 53)
  • (11,60,61)(11, 60, 61), (16,63,65)(16, 63, 65), (33,56,65)(33, 56, 65), (48,55,73)(48, 55, 73)
  • (13,84,85)(13, 84, 85), (36,77,85)(36, 77, 85), (39,80,89)(39, 80, 89), (65,72,97)(65, 72, 97)

Memorizing the first four covers most homework and test questions, since the rest of the common ones are multiples: (6,8,10)(6, 8, 10), (9,12,15)(9, 12, 15), (12,16,20)(12, 16, 20), (15,20,25)(15, 20, 25), (10,24,26)(10, 24, 26) and (30,40,50)(30, 40, 50).

The list has patterns that let you spot-check it. Every hypotenuse of a primitive triple leaves remainder 11 when divided by 44 (5, 13, 17, 25, 29, 37, and so on). Hypotenuses can repeat: 6565 appears twice and so does 8585. That happens because 65=5⋅1365 = 5 \cdot 13 and 85=5⋅1785 = 5 \cdot 17 are products of two primes that are each one more than a multiple of 44. A single such prime, like 1313 or 1717, gives just one primitive triple.

How do you check if three numbers form a Pythagorean triple?

Use this routine every time:

  1. Find the largest number and call it cc, whatever order the numbers were given in.
  2. Square the two smaller numbers and add them.
  3. Square cc and compare. Equal means triple.

Example. Is (15,112,113)(15, 112, 113) a triple? The largest is 113113.

152+1122=225+12544=12769,1132=12769.15^2 + 112^2 = 225 + 12544 = 12769, \qquad 113^2 = 12769.

The two sides match, so it is a triple. It is also primitive, since gcd⁡(15,112)=1\gcd(15, 112) = 1.

The trap that costs the most points is squaring in the order the numbers appear. A triangle labeled (13,5,12)(13, 5, 12) is a triple, but only if 1313 plays the hypotenuse. Students who test 132+5213^2 + 5^2 against 12212^2 wrongly say no.

For large numbers, skip the big squares and use the difference of squares. Rearranging a2+b2=c2a^2 + b^2 = c^2 gives a2=(c−b)(c+b)a^2 = (c - b)(c + b). Here c−b=1c - b = 1 and c+b=225c + b = 225, and 1⋅225=225=1521 \cdot 225 = 225 = 15^2. The check takes seconds.

Reject fakes without squaring

Every triple contains a side divisible by 33, a side divisible by 44 and a side divisible by 55. A candidate like (9,12,16)(9, 12, 16) has no multiple of 55, so it cannot be a triple.

The rule only rejects. A set can pass it and still fail, so confirm with the squares when it survives. Also note that three lengths must make a triangle at all, which the triangle inequality theorem guarantees automatically whenever a2+b2=c2a^2 + b^2 = c^2 holds for positive numbers.

Quick check

Is (20,99,101)(20, 99, 101) a Pythagorean triple?

Euclid’s formula: how to generate Pythagorean triples

Pick whole numbers m>n>0m > n > 0 and compute

a=m2−n2,b=2mn,c=m2+n2.a = m^2 - n^2, \qquad b = 2mn, \qquad c = m^2 + n^2.

Proof of why it works takes one line of algebra:

(m2−n2)2+(2mn)2=m4−2m2n2+n4+4m2n2=m4+2m2n2+n4=(m2+n2)2.(m^2 - n^2)^2 + (2mn)^2 = m^4 - 2m^2n^2 + n^4 + 4m^2n^2 = m^4 + 2m^2n^2 + n^4 = (m^2 + n^2)^2.

The deeper idea is geometric. Dividing a2+b2=c2a^2 + b^2 = c^2 by c2c^2 gives (ac)2+(bc)2=1\left(\frac{a}{c}\right)^2 + \left(\frac{b}{c}\right)^2 = 1, so every triple is a point with fractional coordinates on the unit circle from the equation of a circle. A line from (−1,0)(-1, 0) with slope nm\frac{n}{m} hits the circle again at exactly (m2−n2m2+n2,2mnm2+n2)\left(\frac{m^2 - n^2}{m^2 + n^2}, \frac{2mn}{m^2 + n^2}\right). That is Euclid’s formula in disguise, and it shows why it finds all primitives.

The result is primitive exactly when mm and nn are coprime and one is even, one is odd.

mm nn Triple
2 1 (3,4,5)(3, 4, 5)
3 2 (5,12,13)(5, 12, 13)
4 1 (8,15,17)(8, 15, 17)
4 3 (7,24,25)(7, 24, 25)
5 2 (20,21,29)(20, 21, 29)

Example. Take m=5m = 5 and n=2n = 2. Then a=25−4=21a = 25 - 4 = 21, b=2⋅5⋅2=20b = 2 \cdot 5 \cdot 2 = 20 and c=25+4=29c = 25 + 4 = 29. Check: 212+202=441+400=841=29221^2 + 20^2 = 441 + 400 = 841 = 29^2. The triple is (20,21,29)(20, 21, 29).

Now break the rule on purpose. With m=3m = 3 and n=1n = 1 (both odd), the formula gives (8,6,10)(8, 6, 10), which is just 2⋅(3,4,5)2 \cdot (3, 4, 5). With m=4m = 4 and n=2n = 2 (common factor 22), it gives (12,16,20)(12, 16, 20), which is 4⋅(3,4,5)4 \cdot (3, 4, 5). Both are valid triples, only not primitive.

Euclid needs a multiplier

The bare formula misses triples like (9,12,15)(9, 12, 15). Write the general version as k(m2−n2)k(m^2 - n^2), k(2mn)k(2mn), k(m2+n2)k(m^2 + n^2) and every triple appears.

The derivation of the Pythagorean theorem explains the relationship being used here, while Euclid’s formula explains which whole numbers can satisfy it.

How do you find m and n from a given triple?

Running the formula backward tells you whether a triple is primitive and how it was built. Take the odd leg a=m2−n2a = m^2 - n^2 and the hypotenuse c=m2+n2c = m^2 + n^2. Adding and subtracting them gives

m2=c+a2,n2=c−a2.m^2 = \frac{c + a}{2}, \qquad n^2 = \frac{c - a}{2}.

Example. For (8,15,17)(8, 15, 17), the odd leg is 1515 and c=17c = 17.

m2=17+152=16⇒m=4,n2=17−152=1⇒n=1.m^2 = \frac{17 + 15}{2} = 16 \Rightarrow m = 4, \qquad n^2 = \frac{17 - 15}{2} = 1 \Rightarrow n = 1.

Check: 2mn=2⋅4⋅1=82mn = 2 \cdot 4 \cdot 1 = 8, which is the even leg. Since 44 and 11 are coprime with opposite parity, the triple is primitive.

If the triple is not primitive, divide by the greatest common factor first. For (30,72,78)(30, 72, 78), gcd⁡=6\gcd = 6 and the reduced triple is (5,12,13)(5, 12, 13). That gives m=3m = 3, n=2n = 2 and multiplier k=6k = 6. If the square roots do not come out whole, the numbers are not a triple at all.

Can a single number generate a Pythagorean triple?

Yes. If you know only one leg, two shortcuts work. For an odd number n≥3n \geq 3:

(n,  n2−12,  n2+12).\left(n, \; \frac{n^2 - 1}{2}, \; \frac{n^2 + 1}{2}\right).

For an even number n≥4n \geq 4:

(n,  (n2)2−1,  (n2)2+1).\left(n, \; \left(\frac{n}{2}\right)^2 - 1, \; \left(\frac{n}{2}\right)^2 + 1\right).

Both are Euclid’s formula with special choices. The odd version uses m=k+1m = k + 1 and n=kn = k, which makes the hypotenuse exactly 11 more than a leg. The even version uses n=1n = 1 and m=n2m = \frac{n}{2}. For n=11n = 11 you get (11,1202,1222)=(11,60,61)\left(11, \frac{120}{2}, \frac{122}{2}\right) = (11, 60, 61). For n=12n = 12 you get (12,35,37)(12, 35, 37), since 62−1=356^2 - 1 = 35 and 62+1=376^2 + 1 = 37.

There is a catch with the even formula. When n2\frac{n}{2} is odd the result is not primitive: n=10n = 10 gives (10,24,26)(10, 24, 26), which is 2⋅(5,12,13)2 \cdot (5, 12, 13). And n=2n = 2 gives a side of 00, so it is excluded. A useful consequence: every whole number from 33 upward is a leg of at least one Pythagorean triple, though 11 and 22 are not.

Try this: Use the shortcuts to build triples from n=7n = 7 and n=8n = 8, then check each by squaring.

Quick check

Use the odd-number shortcut with n=13n = 13 to find a triple.

How do you use Pythagorean triples to find a missing side?

Spot the triple inside the numbers you are given. When a problem gives two sides, divide them by their greatest common factor. If the reduced pair matches part of a known triple, the third side follows by multiplying back. This works because any two numbers in a primitive triple are coprime, so the gcd of two given sides is exactly the scale factor kk.

Example 1: missing hypotenuse. The legs are 2424 and 7070.

gcd⁡(24,70)=2⇒(12,35).\gcd(24, 70) = 2 \Rightarrow (12, 35).

The pair (12,35)(12, 35) belongs to (12,35,37)(12, 35, 37), so the hypotenuse is 37⋅2=7437 \cdot 2 = 74. Check: 242+702=576+4900=5476=74224^2 + 70^2 = 576 + 4900 = 5476 = 74^2.

Example 2: missing leg. The hypotenuse is 5050 and one leg is 1414.

gcd⁡(14,50)=2⇒(7,  ?,  25).\gcd(14, 50) = 2 \Rightarrow (7, \; ?, \; 25).

That is (7,24,25)(7, 24, 25), so the other leg is 24⋅2=4824 \cdot 2 = 48. Check: 142+482=196+2304=2500=50214^2 + 48^2 = 196 + 2304 = 2500 = 50^2.

If the reduced pair is not in any known triple, the sides probably do not form one, and you fall back on the theorem with a square root. Test-makers mostly choose triples, so the shortcut hits often. For extra reps, work through these Pythagorean theorem practice problems.

When do Pythagorean triples fail or not apply?

Two famous right triangles can never be triples. In a 45∘45^\circ-45∘45^\circ-90∘90^\circ triangle the hypotenuse is a2a\sqrt{2}, and since 2\sqrt{2} is irrational, no whole aa gives a whole hypotenuse. A 30∘30^\circ-60∘60^\circ-90∘90^\circ triangle has sides aa, a3a\sqrt{3} and 2a2a, which fails for the same reason. See special right triangles for those ratios. Even the (3,4,5)(3, 4, 5) triangle has awkward angles of about 36.87∘36.87^\circ and 53.13∘53.13^\circ, so triples and “nice” angles rarely coincide.

The converse also has a limit. If a2+b2=c2a^2 + b^2 = c^2, the triangle is right. If c2c^2 is larger than a2+b2a^2 + b^2, the largest angle is greater than 90∘90^\circ, and if smaller, every angle is under 90∘90^\circ. Applying this to the three sides 4,5,64, 5, 6: 16+25=4116 + 25 = 41 is greater than 3636, so the triangle is acute. This is one more way to sort the types of triangles using only side lengths.

Triples are about squares only. No whole numbers satisfy a3+b3=c3a^3 + b^3 = c^3, and the same holds for every higher power. That is Fermat’s Last Theorem, finally proved in the 1990s. Finally, a right triangle like (1.5,2,2.5)(1.5, 2, 2.5) is not a triple because the sides are not whole, though doubling gives (3,4,5)(3, 4, 5).

Quick check

A triangle has sides 77, 99 and 1212. Is it right, acute or obtuse?

Where are Pythagorean triples used in real life?

Builders use the 33-44-55 rule to check square corners. Measure 33 feet along one wall, 44 feet along the other, and adjust until the diagonal between the marks is exactly 55 feet. Larger multiples such as 66-88-1010 or 99-1212-1515 reduce measuring error on bigger layouts.

In coordinate geometry, a triple means a clean distance. The distance from (0,0)(0, 0) to (20,21)(20, 21) is 400+441=29\sqrt{400 + 441} = 29, with no radical to simplify. Problem writers use that to keep answers tidy.

Triples also feed area problems. A right triangle with legs 33 and 44 has area 12(3)(4)=6\frac{1}{2}(3)(4) = 6, and the area of a triangle with any Pythagorean triple is always a whole number. It is a close relative of “Heronian” triangles, which have whole-number sides and area but not necessarily a right angle. Heron’s formula shows that the 1313-1414-1515 triangle has area 8484, even though 132+142≠15213^2 + 14^2 \neq 15^2.

Historically, the clay tablet Plimpton 322, around 3,8003{,}800 years old, shows that Babylonian scribes were working with these number patterns long before Pythagoras.

Practice problems

0 of 5 solved

  1. A right triangle has legs 99 and 1212. Find the hypotenuse using a triple.

  2. Use Euclid's formula with m=6m = 6 and n=1n = 1 to build a triple.

  3. A right triangle has one leg 2525 and hypotenuse 6565. Find the other leg.

  4. Find mm and nn for the primitive triple (28,45,53)(28, 45, 53).

  5. Find a Pythagorean triple with one leg equal to 3333 whose hypotenuse is 11 more than the other leg.

Common questions

What are the first Pythagorean triples?

The smallest are (3,4,5)(3, 4, 5), (5,12,13)(5, 12, 13), (8,15,17)(8, 15, 17), (7,24,25)(7, 24, 25) and (20,21,29)(20, 21, 29). Every other triple is a whole-number multiple of one of these or of a larger primitive triple.

What is a primitive Pythagorean triple?

A primitive triple is one whose three numbers share no common factor greater than 11. (3,4,5)(3, 4, 5) is primitive, while (6,8,10)(6, 8, 10) is not because every number is divisible by 22.

How do you generate Pythagorean triples?

Pick whole numbers m>n>0m > n > 0 and compute m2−n2m^2 - n^2, 2mn2mn and m2+n2m^2 + n^2. These always satisfy a2+b2=c2a^2 + b^2 = c^2. Multiply the result by any whole number to get non-primitive triples.

Are there infinitely many Pythagorean triples?

Yes. Every valid pair (m,n)(m, n) in Euclid's formula gives a triple, and every triple can be scaled by 22, 33, 44 and so on. There are infinitely many primitive triples and infinitely many multiples of each.

Is 1, 1, √2 a Pythagorean triple?

No. It is a right triangle, but a Pythagorean triple requires all three sides to be positive whole numbers, and 2\sqrt{2} is not a whole number.

How do you know which number is the hypotenuse in a triple?

The hypotenuse cc is always the largest of the three numbers, no matter what order they are written in. Square the two smaller numbers, add them, and compare with the square of the largest.

Up next