Contents

Pythagorean Triples

From the Pythagorean theorem, we know the relation:

a2+b2=c2 a^2+b^2=c^2

Three positive integers (a,b,c)(a,b,c) that satisfy this equation are called Pythagorean triples. If the three numbers have no common factor other than 1, the triple is called a primitive Pythagorean triple.

If mm and nn are positive integers with m>n>0m>n>0, then one standard form of a Pythagorean triple is:

(a,b,c)=(2mn, m2n2, m2+n2) (a,b,c)=(2mn,\ m^2-n^2,\ m^2+n^2)

Generating Pythagorean triples

Let:

a=2mnb=m2n2c=m2+n2 \begin{aligned} a &= 2mn\\ b &= m^2-n^2\\ c &= m^2+n^2 \end{aligned}

Then:

a2=4m2n2b2=(m2n2)2=m4+n42m2n2a2+b2=4m2n2+m4+n42m2n2=m4+2m2n2+n4=(m2+n2)2=c2 \begin{aligned} a^2 &= 4m^2n^2\\ b^2 &= (m^2-n^2)^2 = m^4+n^4-2m^2n^2\\ a^2+b^2 &= 4m^2n^2 + m^4+n^4-2m^2n^2\\ &= m^4+2m^2n^2+n^4\\ &= (m^2+n^2)^2\\ &= c^2 \end{aligned}

So (2mn, m2n2, m2+n2)(2mn,\ m^2-n^2,\ m^2+n^2) really is a Pythagorean triple.

If the legs and hypotenuse of a right triangle are written in this form, then:

12(2mn)(m2n2)=mn(m2n2) \frac{1}{2}(2mn)(m^2-n^2)=mn(m^2-n^2) 2mn+(m2n2)+(m2+n2)=2mn+2m2=2m(m+n) 2mn+(m^2-n^2)+(m^2+n^2)=2mn+2m^2=2m(m+n)

In some cases, the area and the perimeter are equal. Starting from:

mn(m2n2)=2m(m+n) mn(m^2-n^2)=2m(m+n)

we can derive:

n(mn)=2 n(m-n)=2

Examples:

  • if m=3m=3 and n=1n=1, then area = perimeter = 24
  • if m=3m=3 and n=2n=2, then area = perimeter = 30

A Pythagorean triple (a,b,c)(a,b,c) is called primitive if:

gcd(a,b,c)=1 \gcd(a,b,c)=1

Some useful properties:

  • at least one of aa, bb, or cc is odd
  • one of aa or bb is even
  • cc is always odd

A primitive triple is called twin primitive when the difference between the hypotenuse and the longer leg is 1.

Using:

a=2mnb=m2n2c=m2+n2 \begin{aligned} a &= 2mn\\ b &= m^2-n^2\\ c &= m^2+n^2 \end{aligned}

if a>ba>b, the twin condition gives:

c=a+1m2+n2=2mn+1(mn)2=1mn=1 \begin{aligned} c &= a+1\\ m^2+n^2 &= 2mn+1\\ (m-n)^2 &= 1\\ m-n &= 1 \end{aligned}

So:

m=n+1 m=n+1

If b>ab>a, then:

c=b+1m2+n2=m2n2+12n2=1 \begin{aligned} c &= b+1\\ m^2+n^2 &= m^2-n^2+1\\ 2n^2 &= 1 \end{aligned}

which has no positive integer solution.

A triple is called composite when the three numbers still have a common factor greater than 1.

Prove that if one of aa or bb is even in a primitive Pythagorean triple (a,b,c)(a,b,c), then cc must be odd.

Use an indirect proof. Suppose cc is even while aa and bb are odd.

Write:

a=2p+1b=2m+1c=2n \begin{aligned} a &= 2p+1\\ b &= 2m+1\\ c &= 2n \end{aligned}

Substitute into the Pythagorean equation:

a2+b2=c2(2p+1)2+(2m+1)2=(2n)24p2+4p+1+4m2+4m+1=4n2p2+p+m2+m+12=n2 \begin{aligned} a^2+b^2 &= c^2\\ (2p+1)^2 + (2m+1)^2 &= (2n)^2\\ 4p^2+4p+1 + 4m^2+4m+1 &= 4n^2\\ p^2+p+m^2+m+\frac{1}{2} &= n^2 \end{aligned}

The left-hand side is not an integer, but n2n^2 must be an integer. This contradiction shows that cc cannot be even. Therefore, cc must be odd.

Find all primitive Pythagorean triples (a,b,c)(a,b,c) with bb even and c40c \le 40.

Take:

a=m2n2b=2mnc=m2+n2 \begin{aligned} a &= m^2-n^2\\ b &= 2mn\\ c &= m^2+n^2 \end{aligned}

with conditions:

  • m>n>0m>n>0
  • mm and nn are relatively prime
  • mm and nn are not both odd
  • m2+n240m^2+n^2 \le 40

The valid results are:

mmnna=m2n2a=m^2-n^2b=2mnb=2mnc=m2+n2c=m^2+n^2Triple
21345(3,4,5)(3,4,5)
3251213(5,12,13)(5,12,13)
4115817(15,8,17)(15,8,17)
4372425(7,24,25)(7,24,25)
52212029(21,20,29)(21,20,29)
61351237(35,12,37)(35,12,37)

General steps:

  1. choose two natural numbers mm and nn with m>nm>n
  2. compute m2n2m^2-n^2, 2mn2mn, and m2+n2m^2+n^2
  3. those three values form a Pythagorean triple

Examples:

mmnnm2n2m^2-n^22mn2mnm2+n2m^2+n^2Triple
21345(3,4,5)(3,4,5)
318610(6,8,10)(6,8,10)
3251213(5,12,13)(5,12,13)
4372425(7,24,25)(7,24,25)
5494041(9,40,41)(9,40,41)
65116061(11,60,61)(11,60,61)

Notes:

  • every multiple of a Pythagorean triple is also a Pythagorean triple
  • Pythagorean triples are not limited to integers; they also appear with rational or irrational numbers, such as (3,3,32)(3,3,3\sqrt{2}) or (32,2,52)\left(\frac{3}{2},2,\frac{5}{2}\right)

Pythagorean triples provide a fast way to build right triangles without starting from scratch every time. Once the basic formula and the primitive conditions are understood, many useful numerical patterns become easy to generate.

Related Content