Almost everyone learns the Pythagorean theorem in school. Today, we will discuss something you may or may not have learned about: Pythagorean triples! If you haven’t heard of these, take a look at the following picture of a right triangle:

What’s special about this triangle is that the side lengths are all whole numbers and it’s a right triangle! Together, these are what make this triangle special. Finding triangles with whole-number-length sides is easy, and so is finding right triangles. However, finding right triangles with whole-number-length sides is unique.

A Pythagorean triple is the triplet of whole numbers that represent the three sides lengths of a right triangle with whole number side lengths: (side,side,hypotenuse).(\mathrm{side},\,\mathrm{side},\,\mathrm{hypotenuse}). (Recall that the hypotenuse is the longest side of the right triangle) Thus, our triangle above is the Pythagorean triple (3,4,5).(3,\,4,\,5).

Question: How do we really know that the above triangle is really a right triangle?

Great question! We all remember the Pythagorean theorem (right?) that states: if a triangle is a right triangle with side lengths aa and bb and hypotenuse c,c, then a2+b2=c2.a^2 + b^2 = c^2. As it turns out, the converse1 to the Pythagorean theorem is also correct; that is: if a triangle has side lengths that satisfy a2+b2=c2,a^2 + b^2 = c^2, then the triangle is a right triangle. Therefore, all we have to do is check whether or not the triangle satisfies the Pythagorean theorem. Checking the above triangle, we indeed have 32+42=9+16=25=52.3^2+4^2 = 9+16 = 25 = 5^2. (Check out this article if you want to see a short, visual proof of the Pythagorean theorem).

With the above observation, we could equivalently say that a Pythagorean triple is a triplet of whole numbers (a,b,c),(a,b,c), that satisfy the Pythagorean theorem: a2+b2=c2.a^2 + b^2 = c^2.

If your experience was anything like mine, you were simply told to memorize a handful of these triples and then moved on to the next topic. We never learned how we could find our own triples without guessing or trial and error. But that can’t be the only way people discovered these special triangles, since back 3,700 years ago people figured out that (3367,3456,4825)(3367, 3456, 4825) is a Pythagorean triple! There is no way someone found this by guessing! There must be some logical method, or maybe a formula, to find at least some triples. (As it turns out, there is a formula to compute all Pythagorean triples!) Our goal for today is to deduce a formula that determines all Pythagorean triples, and then prove that the formula works. Very ambitious! So, let’s get started.

Remark: The way this article is laid out is meant to emulate how we might have discovered the formula ourselves. Of course, this makes it potentially more challenging to understand on your first reading than it would be to simply read a proof of the formula. For this reason, I want to mention at the beginning that there is a formal proof of the formula later on so that if you have any confusion during the discovery process, you know that there is a clearly outlined condensed proof as well.

Pythagorean Triples

Definition (Pythagorean Triple): A triplet of natural numbers,2 (a,b,c)(a,b,c), that satisfy the equation, a2+b2=c2,a^2 + b^2 = c^2, is known as a Pythagorean triple.

Pythagorean Triple (a,b,c)(a,b,c) iff a2+b2=c2,wherea,b,c.a^2 + b^2 = c^2,\;\;\mathrm{where}\;\;a,b,c\in \N.

Examples of Pythagorean Triples and Setting the Stage

Before we start trying to find all Pythagorean triples, let’s first see a few more examples:

  1. (5,12,13)\;\;(5,\,12,\,13) is a Pythagorean triple since 52+122=25+144=169=132.5^2+12^2 = 25+144 = 169 = 13^2.
  2. (8,15,17)\;\;(8,\,15,\,17) is a Pythagorean triple since 82+152=64+225=289=172.8^2+15^2 = 64+225 = 289 =17^2.

But wait… take a look at the first, fourth, and fifth examples. Multiplying the triplet in (i) by 2, we get the triplet in (iv):

(2𝟑)2+(2𝟒)2=(2𝟓)2isthesameas62+82=102.(2\cdot{\color{red}{\mathbf3}})^2+(2\cdot{\color{red}\mathbf{4}})^2 = (2\cdot{\color{red}\mathbf{5}})^2 \qquad \mathrm{is}\;\mathrm{the}\;\mathrm{same}\;\mathrm{as}\qquad 6^2+8^2 =10^2.

Similarly, multiplying the triplet in (i) by 3 yields the triplet in (v), and this might make sense. If (a,b,c)(a,b,c) is a Pythagorean triple, then so is (na,nb,nc)(na,\,nb,\,nc) because we can factor out an n2n^2 from each term in the Pythagorean theorem (because each term in the Pythagorean theorem is being squared).3

(na)2+(nb)2=(nc)2,n2a2+n2b2=n2c2,n2(a2+b2)=n2c2,(a2+b2)=c2.\;\;\;\;\;\;\;\;\;(na)^2 +(n b)^2 = (nc)^2,\\\implies \;\;n^2a^2 +n^2 b^2 \;\,= n^2c^2, \\ \implies \,{n^2}(a^2+b^2)\;\;\;\,= n^2c^2, \\ \implies\;\;\;\; (a^2+b^2)\;\;\;\;=c^2.

This motivates us to focus more on Pythagorean triples where none of the integers share a common factor, such as (3,4,5)(3,\,4,\,5) or (5,12,13).(5,\,12,\,13). We even have a special name for such Pythagorean triples:

Definition (Primitive Triples): Let (a,b,c)(a,b,c) be a triple of integers. If gcd(a,b,c)=1,\gcd{(a,b,c)}=1, then we call (a,b,c)(a,b,c) a primitive triple.

Remark 1: Note that gcd(a,b,c)=1\gcd{(a,b,c)}=1 means the greatest common divisor of a,a, b,b, and c,c, is equal to 1. That is, there is no number dd\in \N such that d|a,d|b,andd|cd\mid a,\;d\mid b,\;\mathrm{and}\;d\mid c other than 1. Recall that d|ad\mid a means that dd divides aa or equivalently, aa is a multiple of d.d.

Remark 2: In general, gcd(a,b,c)=1\gcd{(a,b,c)}=1 in the above manner is different than being pairwise relatively prime or pairwise primitive.4 Pairwise primitive means that gcd(a,b)=1,\gcd{(a,b)}=1, gcd(a,c)=1,\gcd{(a,c)}=1, and gcd(b,c)=1.\gcd{(b,c)}=1. In general, a triple being pairwise primitive is a stronger statement about common factors between the three integers than being primitive is. To highlight the distinction, consider the triple of integers (6,10,15).(6,10,15). Taking stock of each greatest common divisor, we have

{gcd(6,10,15)=1}(6,10,15)isprimitive, {gcd(6,10)=2,gcd(6,15)=3,gcd(10,15)=5.}(6,10,15)isNOTpairwiseprimitive\;\big\{\gcd{(6,10,15)}=1\big\} \implies (6,10,15)\;\mathrm{is}\;\mathrm{primitive},\\\ \\ \;\,\begin{Bmatrix}\gcd{(6,10)}=2, \\\gcd{(6,15)}=3, \\ \gcd{(10,15)}=5.\end{Bmatrix}\;\implies (6,10,15)\;\mathrm{is}\;\mathrm{NOT}\;\mathrm{pairwise}\;\mathrm{primitive}

We can see from this example that (6,10,15)(6,10,15) is a primitive triple; however, (6,10,15)(6,10,15) is not pairwise primitive. So, primitivity does not imply pairwise primitivity. However, we might see that if (a,b,c)(a,b,c) is pairwise primitive, then (a,b,c)(a,b,c) is primitive. In shorthand:

Pairwise Primitive\impliesPrimitive.

As it turns out, for Pythagorean triples, we have both implications. That is, (a,b,c)(a,b,c) is pairwise primitive if and only if (a,b,c)(a,b,c) is primitive! How nice!

Proposition 1: Let (a,b,c)(a,b,c) be a Pythagorean triple. Then, (a,b,c)(a,b,c) is a primitive triple if and only if (a,b,c)(a,b,c) is pairwise primitive.

Proof: (Click in the Discovery)

Let (a,b,c)(a,b,c) be a Pythagorean triple.

Forward: Primitive implies pairwise primitive.

Let (a,b,c)(a,b,c) be a primitive triple. Since we are trying to prove a statement about the greatest common divisor between pairs of numbers in our triple, let

gcd(a,b)=d1gcd(a,c)=d2gcd(b,c)=d3.\begin{align} \gcd{({a},{b})} = d_1\\ \gcd({a},{c}) = d_2\\ \gcd({b},{c}) = d_3. \end{align}

For d1,d2,d3.d_1,d_2,d_3\in \N. We will proceed by contradiction.

Assume for the hope of a contradiction that d1>1d_1>1. By the fundamental theorem of arithmetic, there is some prime pp that divides d1.d_1. Hence p|ap\mid a and p|b.p\mid b. It follows p|a2p\mid a^2 and p|b2p\mid b^2 and thus we conclude that p|(a2+b2).p\mid (a^2+b^2) . However, a2+b2=c2,a^2 + b^2 = c^2, so we have just concluded that p|c2.p\mid c^2. This can only happen if p|c.p\mid c. (To rigorously prove that: p|c2p|c,p\mid c^2 \implies p\mid c, see here for Euclid’s lemma or Euler’s Lemma here). Moral of the story is that pp divides every number in our triple: p|a,p|b,andp|c.p\mid a, \;p\mid b,\mathrm{and}\;p\mid c. However, this means gcd(a,b,c)p\gcd{(a,b,c)}\geq p which contradicts our assumption that (a,b,c)(a,b,c) is primitive. Thus, there cannot be any prime numbers that divide d1.d_1. This can only happen when d1=1.d_1=1.

A similar argument can be used to deduce d2=d3=1.d_2=d_3=1.

Backward: Pairwise primitive implies primitive.

Let (a,b,c)(a,b,c) be pairwise primitive, that is, gcd(a,b)=1,\gcd{(a,b)}=1, gcd(a,c)=1,\gcd{(a,c)}=1, and gcd(b,c)=1.\gcd{(b,c)}=1. It follows that gcd(a,b,c)=1.\gcd{(a,b,c)}=1. (Why?) Once you figure out why, we have concluded the proof.

\square

Okay, let’s modify our goal for today to: Deduce a formula that determines all primitive Pythagorean triples.

Now that we have some information about a,a, b,b, and cc (they share no factors) let’s move on and see what we can deduce about a,b,andca,\;b,\;\mathrm{and}\;c from this information.

Parity Problems

Now that we are after the triple a,a, b,b, and cc that share no factors, the next question we might ask is whether or not a,a, b,b, or cc can be even. Let’s experiment a little with the equation a2+b2=c2a^2 + b^2 = c^2 to see if we can say anything about the parity (even/odd-ness) of a,b,a,b, and c.c.

We have 23=82^3 = 8 possible ways to have a2+b2=c2a^2 + b^2 = c^2 when we are only focusing on the even/odd-ness of a,a, b,b, and c.c. However, we can rule out some of them because they are not possible. I challenge you to fill in the right-most column of the table with a YES/MAYBE or a NO in the rightmost column.

aabbccIs it possible to satisfy
a2+b2=c2a^2 + b^2 = c^2?
eveneveneven?
evenevenodd?
evenoddeven?
evenoddodd?
oddeveneven?
oddevenodd?
oddoddeven?
oddoddodd?

Seriously, give it a try and fill out as much as you can!

Filled in Table: (Click in the Discovery)

Here’s what I got:

aabbccIs it possible to satisfy
a2+b2=c2a^2 + b^2 = c^2?
evenevenevenYes, but not primitive.
evenevenoddNO!
evenoddevenNO!
𝐞𝐯𝐞𝐧\Large\color{Green}\mathbf{even}𝐨𝐝𝐝\Large\color{Green}\mathbf{odd}𝐨𝐝𝐝\Large\color{Green}\mathbf{odd}𝐌𝐚𝐲𝐛𝐞\Large\color{Green}\mathbf{Maybe}
oddevenevenNO!
𝐨𝐝𝐝\Large\color{Green}\mathbf{odd}𝐞𝐯𝐞𝐧\Large\color{Green}\mathbf{even}𝐨𝐝𝐝\Large\color{Green}\mathbf{odd}𝐌𝐚𝐲𝐛𝐞\Large\color{Green}\mathbf{Maybe}
𝐨𝐝𝐝\Large\color{Green}\mathbf{odd}𝐨𝐝𝐝\Large\color{Green}\mathbf{odd}𝐞𝐯𝐞𝐧\Large\color{Green}\mathbf{even}𝐌𝐚𝐲𝐛𝐞\Large\color{Green}\mathbf{Maybe}
oddoddoddNO!

The way we filled this out was by noting that (even)2=even(\mathrm{even})^2 =\mathrm{even} and (odd)2=odd(\mathrm{odd})^2 =\mathrm{odd} together with the facts that

even+even=eveneven+odd=oddodd+even=oddodd+odd=even.\mathrm{even}+ \mathrm{even}=\mathrm{even}\\ \mathrm{even}+ \mathrm{odd} \;=\mathrm{odd}\\\mathrm{odd}\;+ \mathrm{even}=\mathrm{odd}\\\mathrm{odd}\;+ \mathrm{odd}\;=\mathrm{even}.

I encourage you to verify these facts if you are unfamiliar with them.


Ignoring the first situation that is not primitive and all the impossible situations, we only have the three green possibilities left:

  • (even)2+(odd)2=?(odd)2,(\mathrm{even})^2+ (\mathrm{odd})^2\overset{?}{=}(\mathrm{odd})^2,
  • (odd)2+(even)2=?(odd)2,(\mathrm{odd})^2+ (\mathrm{even})^2\overset{?}{=}(\mathrm{odd})^2,
  • (odd)2+(odd)2=?(even)2.(\mathrm{odd})^2+ (\mathrm{odd})^2\overset{?}{=}(\mathrm{even})^2.

Since there isn’t really anything different between aa and bb in the equation a2+b2=c2,a^2 + b^2 = c^2 , we can consider the first two situations to be equivalent. With this, we have only two distinct situations to focus on:

  • (odd)2+(even)2=?(odd)2(\mathrm{odd})^2+ (\mathrm{even})^2\overset{?}{=}(\mathrm{odd})^2,
  • (odd)2+(odd)2=?(even)2.(\mathrm{odd})^2+ (\mathrm{odd})^2\overset{?}{=}(\mathrm{even})^2.

However, we claim that we can never have the second situation: (odd)2+(odd)2(even)2,(\mathrm{odd})^2+ (\mathrm{odd})^2\neq(\mathrm{even})^2, leaving only one situation left (odd)2+(even)2=(odd)2,(\mathrm{odd})^2+ (\mathrm{even})^2\overset{\checkmark}{=}(\mathrm{odd})^2, such as 32+42=52.3^2+4^2 = 5^2. We cannot see why (odd)2+(odd)2(even)2(\mathrm{odd})^2+ (\mathrm{odd})^2\neq(\mathrm{even})^2 using our table, we need something more…

Going Beyond Parity

Our goal for this section is to show that we can’t have: (odd)2+(odd)2=(even)2.(\mathrm{odd})^2+ (\mathrm{odd})^2=(\mathrm{even})^2. Let’s see if we can discover why together.

A good tip is to try out some examples, see what happens, and try to spot patterns. In this case, let’s choose two random odd numbers and see what we get when we calculate (odd)2+(odd)2.(\mathrm{odd})^2+ (\mathrm{odd})^2.

aabba2+b2a^2 + b^2
112
1310
5774
59106

Notice anything yet? No? Why don’t you take a moment and compute some more examples? I’ll give you a hint: see how many powers of 2 divide a2+b2.a^2 + b^2.


Go on… you got it!


Okay, did you notice that 2 divides a2+b2a^2 + b^2 only once? In other words, 4 does not divide a2+b2a^2 + b^2 when aa and bb are odd. Let’s see why.

The long way to see why 4 cannot divide a2+b2a^2 + b^2 is by noting that odd numbers are of the form: odd=2m+1\mathrm{odd}=2m+1 for some m.m\in \Z. Thus, a=2k+1a = 2k+1 and b=2t+1b = 2t+1 for some k,t.k,t\in \Z. Plugging these into a2+b2a^2 + b^2 gives

a2+b2=(2k+1)2+(2t+1)2=(4k2+4k+1)+(4t2+4t+1)=4(k2+t2+k+t)+2=4q+2.a^2 + b^2 = (2k+1)^2 + (2t+1)^2 \\\qquad\;\;\;\;= (4k^2+4k+1)+(4t^2+4t+1)\\\qquad\;\;\;\;= 4(k^2 + t^2 + k+t) + 2\\\qquad\;\;\;\;=4q + 2.

Where q=k2+t2+k+t.q=k^2+t^2 +k+t. Note that a2+b2a^2 + b^2 isn’t a multiple of 4. In fact, a2+b2a^2 + b^2 is two more than a multiple of 4. We can now see that 4 cannot divide a2+b2.a^2 + b^2. (There is a quicker way to see that 4a2+b2,4\nmid a^2 + b^2, see the footnote).5 In summary, we have the lemma:

Lemma 1 (An impossibility): It is impossible for (odd)2+(odd)2=(even)2.(\mathrm{odd})^2+ (\mathrm{odd})^2=(\mathrm{even})^2. Or,

(odd)2+(odd)2(even)2(\mathrm{odd})^2+ (\mathrm{odd})^2\neq(\mathrm{even})^2

for all odd and even integers.

Taking the Next Step

So we have seen that any primitive triple (a,b,c)(a,b,c) that solves a2+b2=c2a^2 + b^2 = c^2 must be of the form: (odd,even,odd),(\mathrm{odd},\,\mathrm{even},\,\mathrm{odd}), i.e., (odd)2+(even)2=(odd)2.(\mathrm{odd})^2+ (\mathrm{even})^2=(\mathrm{odd})^2. The next step is to start playing around with a2+b2=c2a^2 + b^2 = c^2 using these facts.

Playing around with Pythagoras…

Let’s suppose that we have found a solution a2+b2=c2,a^2 + b^2 = c^2, where aa and cc are odd, bb is even, and (a,b,c)(a,b,c) is a primitive triple. Remembering that we can factor a difference of squares, let’s move a2a^2 to the other side of the equation and then factor:

b2=c2a2=(ca)(c+a).b^2 = c^2 – a^2 = (c-a)(c+a).

Okay, nothing really stands out, but at least it’s a start. We’ve had a lot of luck by considering what factors different terms have in common, so let’s try to take a look at the question: do (c+a)(c+a) and (ca)(c-a) have any common factors? Let’s see.

Suppose gcd((c+a),(ca))=d.\gcd{\Big( (c+a)\,,\,(c-a)\Big) } = d. It follows that (c+a)=dm(c+a) = dm and (ca)=dn(c-a) = dn for n,m.n,m \in \N. Adding and subtracting these, we get 2a=d(mn)2a = d(m-n) and 2c=d(m+n).2c = d(m+n). In other words (or symbols), d|2ad\mid 2a and d|2c.d\mid 2c. However, we know that gcd(a,c)=1\gcd{(a,c)} = 1 since (a,b,c)(a,b,c) is a primitive Pythagorean triple. Therefore, d=2d = 2 and (c+a)=2m(c+a) = 2m and (ca)=2n(c-a) = 2n where gcd(m,n)=1.\gcd{(m,n) } = 1. (Can you prove that?6) Furthermore, since b2=(ca)(c+a),b^2 = (c-a)(c+a), with b,(ca),and,(c+a)b,\,(c-a),\,\mathrm{and},\,(c+a) all being even we can write,

β2=(ca)2(c+a)2=mn.\beta^2 = \frac{(c-a)}{2}\cdot\frac{(c+a)}{2} = mn.

where b=2β.b = 2 \beta. We now have two relatively prime numbers mandnm\;\mathrm{and}\; n multiplying together to equal a square number (β2).\big(\beta^2\big). Is there anything we can deduce from these facts? As it turns out, it must be that nandmn \;\mathrm{and}\; m are themselves square numbers. That is, m=(c+a)/2=x2m=(c+a)/2 = x^2 and n=(ca)/2=y2n=(c-a)/2 = y^2 for some x,y.x,y\in \N. And since gcd(m,n)=1\gcd{(m,n) } = 1 we also have gcd(x,y)=1.\gcd{(x,y)} = 1. We now have

β2=x2y2.\begin{align} \beta^2 = x^2 y^2. \end{align}

The reason that nn and mm are square numbers can be seen by focusing on the prime divisors of β.\beta. If some prime number p|β,p\mid \beta, then p|np\mid n or p|m,p\mid m, but pp cannot divide both because gcd(m,n)=1.\gcd{( m,n) } = 1. Therefore, all the primes that divide β2\beta^2 must get partitioned between the factors of nandm.n\;\mathrm{and}\; m. More precisely, letting

β2=p12e1p22e2pr2er,\beta^2 = p_1^{2e_1} p_2^{2e_2} \cdots p_r^{2e_r},

then, p1|mp_1\mid m implies p1np_1\nmid n and p12e1|m.p_1^{2e_1}\mid m. Therefore, every prime shows up in the prime factorizations of nn and mm will show up with an even exponent,

m=(c+a)2=pi12ei1pi22ei2piu2eiuandn=(ca)2=pj12ej1pj22ej2pjv2ejv.m=\frac{(c+a)}{2} = p_{i_1}^{2e_{i_1}} p_{i_2}^{2e_{i_2}} \cdots p_{i_{u}}^{2e_{i_{u}}} \qquad \mathrm{and}\qquad n=\frac{(c-a)}{2} = p_{j_1}^{2e_{j_1}} p_{j_2}^{2e_{j_2}} \cdots p_{j_{v}}^{2e_{j_v}} .

Thus,

m=(pi1ei1pi2ei2piueiu)2andn=(pj1ej1pj2ej2pjvejv)2.m = \Big(p_{i_1}^{e_{i_1}} p_{i_2}^{e_{i_2}} \cdots p_{i_{u}}^{e_{i_{u}}}\Big)\,^2 \qquad \mathrm{and}\qquad n = \Big(p_{j_1}^{e_{j_1}} p_{j_2}^{e_{j_2}} \cdots p_{j_{v}}^{e_{j_v}} \Big)\,^2 .

Of course, this wasn’t a rigorous proof of this fact, so I challenge you to fill in some of the details of the following “proof”.

Lemma 2: Let mn=Bkmn = B^k with gcd(m,n)=1\gcd{(m,n)} = 1. Then, there are natural numbers q,rq,r\in \N such that

m=qkandn=rk.m = q^k \qquad \mathrm{and}\qquad n = r^k.

Moreover, gcd(q,r)=1.\gcd{(q,r)} = 1.

In other words, mm and nn are themselves kthk^{th} powers.

Proof: (Click in the Discovery)

Let mn=Bkmn = B^k with gcd(m,n)=1\gcd{(m,n)} = 1. Also, let B=i=1spiei=p1e1pses.B= \prod_{i=1}^sp_i^{e_i} =p_1^{e_1} \cdots p_s^{e_s}. It follows,

Bk=i=1spikei=p1ke1pskes.B^k = \prod_{i=1}^sp_i^{ke_i} =p_1^{ke_1} \cdots p_s^{ke_s}.

Since p1k1e1|mnp_1^{k_1e_1} \mid mn and gcd(m,n)=1,\gcd{(m,n)} = 1, we deduce p1k1e1|mp_1^{k_1e_1} \mid m or p1k1e1|np_1^{k_1e_1} \mid n using Euclid’s lemma. However, p1k1e1p_1^{k_1e_1} cannot divide both mm and nn because gcd(m,n)=1\gcd{(m,n)} = 1. A similar argument can be made regarding all the prime powers pikieip_i^{k_ie_i} . It follows,

m=pi1kei1pi2kei2piukeiu=(pi1ei1pi2ei2piueiu)km= p_{i_1}^{ke_{i_1}}\cdot p_{i_2}^{ke_{i_2}}\cdots p_{i_u}^{ke_{i_u}} = (p_{i_1}^{e_{i_1}}p_{i_2}^{e_{i_2}}\cdots p_{i_u}^{e_{i_u}})^k

and

n=pj1kej1pj2kej2pjvkejv=(pj1ej1pj2ej2pjvtjv)k.n= p_{j_1}^{ke_{j_1}}\cdot p_{j_2}^{ke_{j_2}}\cdots p_{j_v}^{ke_{j_v}} = (p_{j_1}^{e_{j_1}}p_{j_2}^{e_{j_2}}\cdots p_{j_v}^{t_{j_v}})^k.

(Can you fill in the steps to make this fully rigorous?)

\square

Using Lemma 2, we can properly say m=(c+a)/2=x2m=(c+a)/2 = x^2 and n=(ca)/2=y2n=(c-a)/2 = y^2 for some x,yx,y\in \N such that gcd(x,y)=1.\gcd{(x,y)} = 1.

In summary, we have just determined that b2=4β2=4x2y2b^2 = 4\beta^2 = 4x^2y^2 where,

x2=(c+a)2,andy2=(ca)2.x^2 =\frac{(c+a)}{2},\qquad\mathrm{and}\qquad y^2 =\frac{(c-a)}{2}.

We can solve for both aa and cc using the equations above for xx and y.y. Doing so yields,

a=x2y2,andc=x2+y2.a =x^2 – y^2,\qquad\mathrm{and}\qquad c =x^2+ y^2 .

From these, we determine b.b. See what you get for bb before reading on.

Plugging our equations for aa and cc back into a2+b2=c2a^2 + b^2 = c^2 and then solving for bb gives b=2xy.b = 2xy. ***Or, we could have simply used b2=4β2=4x2y2.b^2 = 4\beta^2 = 4x^2y^2.***

Wait just a gosh darn minute! We have what we wanted, a way to find Pythagorean triples! All we do is choose some x,yx,y\in \N with gcd(x,y)=1\gcd{(x,y)} = 1 and then plug those into the following:

a=x2y2,andb=2xyandc=x2+y2.a =x^2 – y^2,\qquad\mathrm{and}\qquad b = 2xy\qquad\mathrm{and}\qquad c =x^2+ y^2 .

How awesome is this? Answer: Very awesome!

Before we find some triples, let’s prove the following theorem we were led to :

Theorem (Primitive Pythagorean Triples): A triple (a,b,c)(a,b,c) is a primitive pythagorean triple with aa odd and bb even if and only if

a=x2y2,andb=2xyandc=x2+y2,a =x^2 – y^2,\qquad\mathrm{and}\qquad b = 2xy\qquad\mathrm{and}\qquad c =x^2+ y^2 ,

for some for x,yx,y\in \N such that gcd(x,y)=1\gcd{(x,y)} = 1 and either xx or yy is even (but not both!).

We pretty much went through the proof in our discovery process; however, just in case you found that portion confusing, here is an organized formal proof. Also, we have a condition that was not immediately obvious from our discovery process: either xx or yy is even (but not both!). As we will see, this is not hard to prove.

Proof: (Click in the Discovery)

Forward: If (a,b,c)(a,b,c) is a primitive Pythagorean triple then a=x2y2,a =x^2 – y^2, b=2xy,b = 2xy, and c=x2+y2,c =x^2+ y^2 , for some for x,yx,y\in \N such that gcd(x,y)=1\gcd{(x,y)} = 1 and either xx or yy is even.

Let (a,b,c)(a,b,c) be a primitive Pythagorean triple. Using Lemma 1, we know that aa or bb is even (but not both) and cc is odd. So, let’s let bb be even. With some algebra, we deduce

b2=c2a2=(ca)(c+a).b^2 = c^2 – a^2 = (c-a)(c+a).

Since both aa and cc are odd, (c+a)(c+a) and (ca)(c-a) are even and hence (c+a)/2=m(c+a)/2 = m and (c+a)/2=n(c+a)/2 = n for m,n.m,n\in \N. Furthermore,

(b2)2=mn.\Big(\frac{b}{2} \Big)\,^2 = mn.

By Lemma 2,

x2=m=(c+a)2,andy2=n=(ca)2x^2 =m=\frac{(c+a)}{2},\qquad\mathrm{and}\qquad y^2 =n=\frac{(c-a)}{2}

for and x,yx,y\in \N such that gcd(x,y)=1.\gcd{(x,y)} = 1.

We can now solve for aa, b,b, and cc. Doing so gives (part of) our desired results:

a=x2y2,andb=2xyandc=x2+y2.a =x^2 – y^2,\qquad\mathrm{and}\qquad b = 2xy\qquad\mathrm{and}\qquad c =x^2+ y^2 .

All we need to show is that either xx or yy is even (not not both!). Since gcd(x,y)=1\gcd{(x,y)} = 1 we can’t have both xx and yy being even. Also, if xx and yy were both odd, then aa and cc would both be even, contradicting that (a,b,c)(a,b,c) be a primitive Pythagorean triple.

Backward: Left for your enjoyment. (You’re welcome)

Hint: Plug in a=x2y2a =x^2 – y^2 and b=2xy b = 2xy into the Pythagorean Theorem and show that we get c=x2+y2.c =x^2+ y^2 .

\squareand to

Let’s Find a Large Pythagorean Triple!

Now that we have a formula that gives us a primitive Pythagorean triple, let’s use it!

First, let’s do a quick, small example. Maybe x=2x=2 and y=1y=1. In this case: a=41=3,b=221=4,a = 4-1 = 3,\;\;b = 2\cdot2\cdot1 = 4,\;\;and c=4+1=5.c = 4+1 =5. We have just found one of the triples we found before! Okay, okay, let’s compute a large one!

Let’s let x=12345=35823x=12345 = 3\cdot 5 \cdot 823 and y=314=2157y=314 =2\cdot 157. (Note that gcd(x,y)=1\gcd{(x,y)} = 1 and xx is odd and yy is even) Then,

a=1234523142=152,300,429a = 12345^{2} – 314^{2} = 152,300,429
b=2(12345314)=7,752,660b = 2(12345 \cdot 314) = 7,752,660
c=123452+3142=152,497,621.c = 12345^{2} + 314^{2} = 152,497,621.

And as a check,

a2+b2=23,195,420,673,584,041+60,103,737,075,600=23,255,524,410,659,641a^2 + b^2 = 23,195,420,673,584,041 + 60,103,737,075,600 = 23,255,524,410,659,641
c2=23,255,524,410,659,641.c^2 = 23,255,524,410,659,641.

Do you think you could have found these without our theorem?

That reminds me! Way back in the beginning, we mentioned,

” But [guessing or trial and error] can’t be the only way people discovered these special triangles, since back 3,700 years ago people figured out that (3367,3456,4825)(3367, 3456, 4825) is a Pythagorean triple! There is no way someone found this by guessing! “

Now that we have our formula to generate triples, can you determine what values of xx and yy give us the triple: (3367,3456,4825)?(3367, 3456, 4825)? Give it a go!

There’s More Fun to be Had!

It’s amazing that we have found a way to generate all Pythagorean triples. But, in the process, we took it for granted that there are integer solutions to a2+b2=c2a^2 + b^2 = c^2 in the first place. Something that becomes more striking when we learn about Fermat’s last theorem! One interesting fact is that we can use our results today to show that there are no integer solutions to a4+b4=c4.a^4 + b^4 = c^4. This is one case of Fermat’s last theorem that Fermat really proved. There is a plan to write an article about his proof using infinite descent in the (hopefully soon) future!

There are many more questions we can ask that are tangential to our work today that are not about Fermat’s last theorem and that don’t require proofs over 100 pages long! For instance, take a look back at our main theorem. We showed that the hypotenuse cc is a sum of squares, c=x2+y2.c = x^2 + y^2. This begs the question, “Which numbers can be hypotenuses?” Equivalently, “Which numbers can be expressed as the sum of two squares?” Or, more mathy with symbols, for what n,n\in \N, is there an integer solution to x2+y2=n?x^2 + y^2 = n? After playing around with this problem for a while, you might notice that if you can determine which primes pp can be expressed as x2+y2=px^2 + y^2 = p you can then answer the question for all n.n. In fact, this question can be answered in far fewer than 100 pages. It can be answered and proved in one line! (See The One Sentence Proof (in multiple sentences) – Numberphile)

The questions are endless! But this article is already long so I will have to leave you to ponder and problem-solve! Remember to have fun!

Be Kind. Be Curious. Be Compassionate. Be Creative.

And Have Fun!


P.S. One final comment. Since knowing aa and bb determines c,c, we could write our solution as the pair: (a,b)=(x2y2,2xy).(a,b) =(x^2 – y^2,\, 2xy). Hmm… this way of looking at the solution set seems a little… complex… no?7


Footnotes:

  1. The converse to: if A then B; is the statement: if B then A. ↩︎
  2. Natural numbers, denoted \N, are positive whole numbers: ={1,2,3,4,}.\N = \{1,2,3,4,\cdots\}. ↩︎
  3. When every term has the same order (exponent), in our case, each term is of order 2, we call such equations homogeneous. ↩︎
  4. Relatively prime (or coprime) integers are pairs of integers that have gcd(a,b)=1.\gcd{(a,b)} = 1. ↩︎
  5. The slick way to prove that (odd)2+(odd)2(\mathrm{odd})^2+ (\mathrm{odd})^2 is not divisible by 4 is to use modular arithmetic. The proof would be something like this:
    Proof Idea: For any aa\in \Z we have (odd)2+(odd)21+1=2(mod4).(\mathrm{odd})^2+ (\mathrm{odd})^2 \equiv 1+1 = 2 \;(\mathrm{mod}\;4). (why?) Which is not zero mod 4. ↩︎
  6. Let gcd(m,n)=d.\gcd{(m,n)}=d. Our goal is to prove gcd(md,nd)=1.\gcd{(\frac{m}{d},\frac{n}{d})}=1.
    Suppose, on the contrary, that gcd(md,nd)=D>1;\gcd{(\frac{m}{d},\frac{n}{d})}=D>1; it follows that D|mdD\mid \frac{m}{d} and D|nd.D\mid \frac{n}{d}. Equivalently, md=Dk\frac{m}{d} =Dk and nd=Dt\frac{n}{d} =Dt for some k,t.k,t\in \N. Rearranging these equations, we get
    m=Ddkandn=Ddt.m = Ddk \qquad \mathrm{and}\qquad n = Ddt.Therefore, DdDd is a common divisor of both mm and nn with the property that Dd>d.Dd>d. This contradicts that gcd(m,n)=d.\gcd{(m,n)}=d. ↩︎
  7. Complex as in (x+iy)2,(x+iy)^2, maybe? ↩︎

Leave a comment