# Pythagorean Triples with Common Sides

Authors: Raymond Calvin Ochieng; Chiteng’a John Chikunji; Vitalis Onyango-Otieno
Journal: Journal of Mathematics
 (2019)

---

## Abstract

There exist a finite number of Pythagorean triples that have a common leg. In this paper we derive the formulas that generate pairs of primitive Pythagorean triples with common legs and also show the process of how to determine all the primitive and nonprimitive Pythagorean triples for a given leg of a Pythagorean triple.


---

## Body

## 1. Introduction

A Pythagorean triple (PT) is a triple of positive integers(a,b,c), which satisfy the Pythagorean equation (1)a2+b2=c2,where c represents the length of the hypotenuse; a and b represent the lengths of the other two sides (legs) of a right triangle. We say a Pythagorean triple (a,b,c) is primitive if the numbers a, b, and c are pairwise coprime (see [1]).Several methods have been formulated that generate Pythagorean triples (see [2–9]). For instance, the most common one is the classical Euclid formula [10, 11]: (2)a,b,c=n2-m2,2nm,n2+m2whenever 0<m<n;n,m∈Z+. A triple generated by this method is primitive if and only if (n,m)=1 and (n-m) is odd. Note that (n-m) is odd if n, m have opposite parity [12], or n+m≡1(mod2).Now by Euclid’s general formula, any Pythagorean triple, primitive and nonprimitive triples, can be written as(k(n2-m2),k(2nm),k(n2+m2)), where k is some positive integer and n, m are as defined in [10, 11].Pythagorean triples form different patterns that can be classified and applied in various fields such as cryptography; see [13–20]. For instance, there exist Pythagorean triples (a,b,c) that have identical legs; e.g., (20,21,29) and (20,99,101) are two primitive triples with a=20, while (20,15,25) and (20,48,52) are nonprimitive triples with the same leg. Similarly (105,88,137), (105,208,233), (105,608,617), and (105,5512,5513) are four primitive Pythagorean triples which have 105 as the identical leg. The nonprimitive triples which share the leg 105 are discussed in Example 1.In [1], Sierpinski states and proves that there exist only a finite number of Pythagorean triples with a given leg a. He further states and proves that, for each positive integer n, there exist at least n different Pythagorean triples with the same leg a, where a∈Z+. For instance, if we take (3)a=2n+1,bk=2k22n-2k-1,ck=2k22n-2k+1where k=0,1,2,⋯,n-1, then we obtain n Pythagorean triples (a,bk,ck) with the same leg a and with different hypotenuses.It is also stated in [1] that it is not easy to prove that, for each positive integer n, there exist at least n different primitive Pythagorean triples with an identical leg. However in this paper we prove formula for determining pairs of primitive Pythagorean triples which have identical legs. We also show how to determine all the primitive and nonprimitive Pythagorean triples which have a given identical leg.


## 2. Pairs of Pythagorean Triples with Identical Leg

Consider the following pairs of primitive Pythagorean triples which can be generated from the equation(4)a,b,c=2nm,n2-m2,n2+m2.From Table1, we observe that, for each pair of triples with identical leg, the difference between the hypotenuse and the odd leg is either 8 or 2. We then have (5)a2+b2=b+82,(6)a2+d2=d+22.Solving (5), we obtain (7)a2+b2=b2+16b+6416b=a2-64b=116a2-4.Observe from Table 1 that a is the form a=4(2k+1) where k∈Z+. Substitute this to obtain (8)b=11642k+12-4=4k2+4k+1-4=4k2+4k+-3=4kk+1-3,c=4kk+1-3+8=4kk+1+5.In a similar way, we can obtain b=16k(k+1)+3 and c=16k(k+1)+5 from (6).Table 1
Pairs of primitive Pythagorean triples with identical leg, even.
n m 2 n m n 2 - m 2 n 2 + m 2 3 2 12 5 13 6 1 12 35 37  5 2 20 21 29 10 1 20 99 101  7 2 28 45 53 14 1 28 195 197  9 2 36 77 85 18 1 36 323 325We have thus derived the following.Proposition 1.
Ifa is an even leg of the Pythagorean triple (a,b,c), then the following pair of equations produce primitive Pythagorean triples with identical leg a: (9)a,b,c=42k+1,4kk+1-3,4kk+1+542k+1,16kk+1+3,16kk+1+5for all k∈Z+.Proof.
We show the first equation in (9) is a Pythagorean triple. (10)a2+b2=8k+42+4k2+4k-32=64k2+64k+16+16k4+16k3-12k2+16k3+16k2-12k-12k2-12k+9=16k4+32k3+56k2+40k+25=4k2+4k+52=c2.We then show it is a primitive Pythagorean triple. By Euclid’s formula, (11)a,b,c=2nm,n2-m2,n2+m2is a primitive Pythagorean triple if (n,m)=1, n>m>0, and n, m are integers of opposite parity.
Now,(12)2nm=42k+1(13)n2-m2=4kk+1-3(14)n2+m2=4kk+1+5To solve for n and m, add (13) and (14), to obtain (15)2n2=8k2+8k+2⇔n2=4k2+4k+1⇔n=2k+1for all k∈Z+.
Subtract (13) from (14) to get (16)2m2=8⇔m=2Clearly (n,m)=((2k+1),2)=1; 2k+1>2 for all k∈Z+, and (17)n+m=2k+1+2=2k+1+1≡1mod2.Therefore (9) is a primitive triple.
The last equation in (9), that is, (a,b,c)=(4(2k+1),16k(k+1)+3,16k(k+1)+5), can be shown in a similar manner.Now, consider pairs of PPTs with identical leg, odd, and, similarly, these can be obtained from (2).From Table2, we have two cases considering the difference between the hypotenuse and the leg b.Table 2
Pairs of primitive Pythagorean triples with identical leg, odd.
n m n 2 - m 2 2 n m n 2 + m 2 4 1 15 8 17 8 7 15 112 113 5 2 21 20 29 11 10 21 220 221 6 1 35 12 37 18 17 35 612 613 8 3 55 48 73 28 27 55 1512 1513Case I.
Ifc=b+1, we have (18)a2+b2=b+12a2+b2=b2+2b+1a2=2b+1b=a2-12,c=b+1=a2-12+1=a2+12.
Observe, from Table2, that a is a semiprime; that is, a=pq where p and q are primes, p>q.Case II.
In this case, for some primeq, we have (19)a2+b2=b+q22a2+b2=b2+2bq2+q4a2=2bq2+q4b=a2-q42q2,c=b+q2=a2-q42q2+q2=a2+q42q2.
Substitutea=pq in both cases to obtain the following.Proposition 2.
Leta be the odd leg of a Pythagorean triple (a,b,c), and then (20)a,b,c=pq,p2-q22,p2+q22pq,pq2-12,pq2+12produce a pair of primitive Pythagorean triples with identical odd leg a, for all odd primes p, q with p>q.Proof.
Now(21)a2+b2=pq2+p2-q222=p2q2+p4-2p2q2+q44=p4+2p2q2+q44=p2+q222=c2,that is, the first equation in (20) is a Pythagorean triple. We then show it is primitive. Since both p and q are odd primes, let (22)n2-m2=pq(23)2nm=p2-q22(24)n2+m2=p2+q22.Add (22) and (24) to get (25)2n2=p2+q22+pq⇔n2=p2+2pq+q24⇔n2=p+q22⇔n=p+q2,and subtract (22) from (24) to obtain (26)2m2=p2+q22-pq⇔m2=p2-2pq+q24⇔m=p-q2.But p and q are odd primes so p=2r+1 and q=2s+1 for some r, s∈Z+ with r≠s. Substitute p and q in n and m to obtain (27)n=p+q2=2r+1+2s+12=r+s+1,m=p-q2=2r+1-2s+12=r+s.It follows that the first equation in (20) is a primitive Pythagorean triple for n and m are consecutive positive integers and, hence, are of opposite parity and (n,m)=1.
The second equation in (20) can be shown in a similar way.In [21, 22], a formula is given which determines the number of primitive Pythagorean triples that have a common leg. However, these formulas do not show how to obtain the primitive Pythagorean triples. In Proposition 6, we show how to determine all the primitive as well as nonprimitive Pythagorean triples for a given leg of a Pythagorean triple.For easy reference, we first state and prove the following.Lemma 3 (see [21, 22]).
Consider the triple(a,b,c) of positive integers with a as the even leg. Then the number of primitive Pythagorean triples with a as a common leg is (28)Pa=2ωt-1if4∣a;0if4∤a,where ω(t) is the number of prime divisors of a.Proof.
If(a,b,c) is a primitive Pythagorean triple and a is even, then we have integers n and m such that a=2nm, 0<m<n, (n,m)=1, and n+m≡1(mod2). Each such pair uniquely determines (a,b,c). Since nm is even, there is no solution unless 4∣a. Suppose 4∣a, and suppose n is even, without loss of generality. If P(a) denotes the set of prime divisors of a, any subset of P(a) uniquely determines n, and hence m, since no prime pi can divide both n and m. There are 2ω(t)-1 choices of n, and hence as many choices of expressing a in the form 2nm with (n,m)=1 and n+m≡1(mod2).Lemma 4 (see [21, 22]).
Let(a,b,c) be a Pythagorean triple with a as the odd leg. Then the number of primitive Pythagorean triples with a as a common leg is given by (29)P∗a=2ωt-1where ω(t) is the number of prime divisors of a. Also P∗(1)=0.Proof.
We wish to count the number of positive integer pairsn, m such that n2-m2=a with 0<m<n, (n,m)=1, and n+m≡1(mod2). The parity of a forces both factors n+m, n-m to be odd, so that n, m are of opposite parity. Moreover (n+m,n-m)=1. Choosing the prime factors for one of n+m, n-m determines the prime factors of the other, and n, m are uniquely determined from n+m, n-m. However since we must reserve the larger factor of a for n+m, only half of all the subsets count.The following lemma will be useful in the proof of the proposition below.Lemma 5.
Consider the Pythagorean tripleT=(a,b,c) with a as the even leg. T is not primitive Pythagorean triple if any of the following hold: (1)
ifa is odd(2)
ifa=2r where r is odd(3)
ifa=2.Proof.
If(a,b,c) is a primitive Pythagorean triple, then we have integers n and m such that a=2nm, 0<m<n, (n,m)=1, and n+m≡1(mod2). If a is odd, we contradict a=2nm. If a=2r where r is odd, then n and m are both odd, but then n+m≡1(mod2). If a=2, then n=m=1, a contradiction.We extend the Lemmas3 and 4 to determine all the primitive and nonprimitive Pythagorean triples that have a common leg, either odd or even.Proposition 6.
Let(a,b,c) be a Pythagorean triple. Define P(a)=2ω(t)-1 where ω(t) is the number of prime divisors of a, and R(a)=∑i=1k2ω(ti)-1 where for some di∈Z+ such that di∣a, ω(ti) is the number of prime divisors of a/di for which (a/di,b/di,c/di) is a primitive Pythagorean triple. Then the number of primitive and nonprimitive Pythagorean triples that have a common leg a is P(a)+R(a).Proof.
Suppose the lega is odd, then (a,b,c)=(n2-m2,2nm,n2+m2) is a primitive Pythagorean triple if 0<m<n, (n,m)=1 and n+m≡1(mod2). Then a is of the form (30)a=p1e1p2e2⋯pvev,where p1,p2,…,pv are odd primes and e1,e2,…,ev∈Z+.
By factorization,(31)n2-m2=n+mn-m.We solve for n and m such that xy=a where =n+m, y=n-m, and x>y for all pairs (n,m) in which 0<m<n,(r,s)=1 and n+m≡1(mod2). Each of these pairs corresponds to a primitive Pythagorean triple. By Lemma 4, if ω(t) is the number of prime divisors of a, then the number of primitive Pythagorean triples with common leg a is given by P∗(a)=2ω(t)-1.
If(a,b,c) is a nonprimitive triple then a, b, and c have a greatest common divisor d≠1. The possibilities of d are the factors of a. We eliminate d for the case when a/d=1, that is, the case when a=d. This is because a/d is the leg of a Pythagorean triangle and should satisfy a/d⩾3.
Let the remaining cases ofd be D={d1,d2,…,dk} for some k∈Z+. For each di∈D, (a/di,b/di,c/di) is a primitive Pythagorean triple when (32)adi=n2-m2,bdi=2nm,cdi=n2+m2for 0<m<n, (n,m)=1, and n+m≡1(mod2).
Let the number of prime divisors ofa/di be ω(ti), for each di. Then there are 2ω(ti)-1 primitive Pythagorean triples with a common leg, a/di. Each of these triples is then multiplied by di to obtain nonprimitive Pythagorean triples with the leg a.
The number of all the nonprimitive Pythagorean triples for alldi∈D is given by (33)R∗a=2ωt1-1+2ωt2-1+⋯+2ωtk-1=∑i=1k2ωti-1.Then all primitive and nonprimitive Pythagorean triples are given by P∗(a)+R∗(a) where P∗(a) and R∗(a) are as defined.
Now, suppose that the lega is even, then (a,b,c)=(2nm,n2-m2,n2+m2) is a primitive Pythagorean triple if 0<m<n, (n,m)=1, and n+m≡1(mod2). The leg a is of the form (34)2nm=2e0p1e1p2e2⋯pwev⇔nm=2k-1p1e1p2e2⋯pvevwhere p1,p2,…,pv are odd primes and e0,e1,e2,…,ev∈Z+.
Now the set of generating pairs of positive integers,(n,m) that have opposite parity, are relatively prime and n>m are (35)nm,1,nm2e0-1,2e0-1,nmp1e1,p1e1,nmp2e2,p2e2,…,nmpnen,pwev,…,nmp1e1p2e2,p1e1p2e2,…That is, by Lemma 3, if P(a) denotes the set of prime divisors of a, any subset of P(a) uniquely determines n, and hence m, since no prime pi can divide both n and m. There are 2ω(t)-1 choices of n, and hence as many choices of expressing a in the form 2nm with (n,m)=1.
Suppose(a,b,c)=(2nm,n2-m2,n2+m2) is a nonprimitive Pythagorean triple. Then a, b, and c have a greatest common divisor d≠1. The possibilities of d are drawn from the factors of a. We consider all d such that (a/d,b/d,c/d) is primitive. Two cases arise.
Case I. By Lemma 5, we eliminate any d such that a/d is odd; a/d=2r where r is odd and a/d=2. Moreover, as the even leg of a Pythagorean triangle, a/d>3.
Let the remaining values ofd be D={d1,d2,…,dk} for some k∈Z+. For each di∈D, (a/di,b/di,c/di) is a primitive Pythagorean triple when (36)adi=2nm,bdi=n2-m2,cdi=n2+m2
for0<m<n, (n,m)=1, and n+m≡1(mod2).
We then find all pairs(n,m) such that nm=a/2di. Each of these pairs of (n,m) produces a primitive Pythagorean triple, which is then multiplied by di to produce a nonprimitive triple with leg a as desired.
Case II. We consider d such that a/di>1, odd. Then a/di=n2-m2 and we proceed to determine the primitive triples as described above, for odd case of a. The primitive triples obtained are then multiplied by di to obtain nonprimitive triples with a leg equal to a.
The number of these nonprimitive Pythagorean triples for eachdi is 2ω(ti)-1 where ω(ti) is the number of prime divisors of a/di,i=1,2,…,k. The sum of all these triples is (37)Ra=2ωt1-1+2ωt2-1+⋯+2ωtk-1=∑i=1k2ωti-1.Then the number of all primitive and nonprimitive Pythagorean triples is (38)Pa+Ra,as desired, where P(a) and R(a) are as defined above.We illustrate this with some examples.Example 1.
The proof of Proposition6 lays out an easy way of determining all the Pythagorean triples, both primitive and nonprimitive, that have an identical leg.
Consider the Pythagorean triples with an identical lega=105. If (105,b,c) is a primitive Pythagorean triple, then a=n2-m2=(n+m)(n-m)=105=105×1=35×3=21×5=15×7. Solve for n, m if xy=105, where x=n+m and y=n-m such that x>y. We obtain (n,m)={(53,52),(19,16),(13,8),(11,4)}, which produce the four primitive Pythagorean triples shown in Table 3.
These numbers of primitive triples produced agree with Lemma4; that is, (39)P105=2ωt-1=23-1=4
Now suppose(105,b,c) is nonprimitive, then 105, b, and c have a greatest common divisor d≠1. The possibilities of d are d∈{3,5,7,15,21,35,105}. In this case, we only eliminate d=105, that is, the case when a=d. We then consider the remaining values of d.
Letd=3. Then (35,b/3,c/3) is primitive if (40)n2-m2=35,2nm=b3,n2+m2=c3where n>m>0 such that (n,m)=1 and n+m≡1(mod2). Now 35=n2-m2=(n+m)(n-m). But 35=35×1=7×5, so that (n,m)={(18,17),(6,1)}. These produce the nonprimitive triples: (41)335,612,613,335,12,37=105,1836,1839,105,36,111.In a similar way, d=5 leads to the triples {(105,1100,1105),(105,100,145)}. If d=7, we have {(105,784,791),(105,56,119)}. Finally, each of d=15, 21, and 35, respectively, leads to the triples (105,360,375),(105,252,273), and (105,140,175).
Observe the number of nonprimitive Pythagorean triples described for eachd in Table 4.Table 3
Primitive Pythagorean triples with common lega=105.
n m n 2 - m 2 2 n m n 2 + m 2 53 52 105 5512 5513 19 16 105 608 617 13 8 105 208 233 11 4 105 88 137Table 4
Number of nonprimitive Pythagorean triples with common lega=105 for each value of d.
d a d ω ( t i ) 2 ω ( t i ) - 1 3 35 2 2 5 21 2 2 7 15 2 2 21 5 1 1 35 3 1 1  Total   8Example 2.
Leta=2nm=420=22×3×5×7. This implies nm=210 and by considering its factors, the possible set of pairs of (n,m) are (42)n,m=210,1,105,2,70,3,42,5,35,6,30,7,21,10,15,14.These produce the eight primitive Pythagorean triples shown in Table 5.
Suppose(420,b,c) is nonprimitive, then 420, b, and c have the greatest common divisor d≠1. The possibilities of d are (43)d∈2,3,4,5,6,7,10,12,14,15,20,21,28,30,35,42,60,70,84,105,140,210,420.Two cases arise.
In the first case, by Lemma5, we eliminate all d such that 420/d is odd, 420/d=2r where r is odd and 420/d=2. Moreover 420/d≠1. These conditions exclude the following set d∈{2,4,6,10,12,14,20,28,30,42,60,70,84,140,210,420}.
We consider each of the remaining cases ofd, that is, {3,5,7,15,21,35,105}.
Letd=3, and then (140,b/3,c/3) is primitive when (44)140=2nm,n2-m2=b3,n2+m2=c3,where n>m>0 such that (n,m)=1 and n+m≡1(mod2). Now nm=70 and the possibilities satisfying the conditions above are (n,m)={(70,1),(35,2),(14,5),(10,7)}. These produce the primitive triples (45)140,4899,4901,140,1221,1229,140,171,221,140,51,149.Multiply each of these primitive triples by d=3 to obtain (46)420,14697,14703,420,3663,3687,420,513,663,420,153,447,as desired.
In a similar way the other values ofd lead to the nonprimitive triples  shown in Table 6.
Secondly, we considerd such that a/d is odd. Then d∈{4,12,20,28,60,84,140}.
Letd=4, and then a/d=420/4=105 and as such 105=n2-m2,b=2nm, and c=n2+m2. This has been solved in Example 1. We obtain (n,m)={(53,52),(19,16),(13,8),(11,4)}, which produce triples as in Table 7.
Note that whena/d=105, nonprimitive triples are generated as well. However we find that such triples will be produced in the remaining values of d. For example, primitive triples generated when d=12 are (35,612,613) and (35,12,37), which on multiplying by 12 leads to (420,7344,7356) and (420,144,444), respectively. But (420,7344,7356) and (420,144,444) are, respectively, multiples of (105,1836,1839) and (105,36,111), which are nonprimitive triples when a=105. As such to avoid repetition, we only take the primitive triples that arise from each d.Table 5
Primitive Pythagorean triples with common lega=420.
n m 2 n m n 2 - m 2 n 2 + m 2 210 1 420 4099 44101 105 2 420 11021 11029 70 3 420 4891 4908 42 5 420 1739 1789 35 6 420 1189 1261 30 7 420 851 949 21 10 420 341 541 15 14 420 29 421Table 6
Nonprimitive Pythagorean triples with common lega=420 for each odd value of d.
d ( n , m ) Primitive Triple Non-primitive Triple 5 (42, 1) (84, 1763, 1765) (420, 8815, 8825) (21, 2) (84, 437, 445) (420, 2185, 2225) (14, 3) (84, 187, 205) (420, 935, 1025) (7, 6) (84, 13, 85) (420, 65, 425)  7 (30, 1) (60, 899, 901) (420, 6293, 6307) (15, 2) (60, 221, 229) (420, 1547, 1603) (10, 3) (60, 91, 109) (420, 637, 763) (6, 5) (60, 11, 61) (420, 77, 427)  15 (14, 1) (28, 195, 197) (420, 2925, 2955) (7, 2) (28, 45, 53) (420, 675, 795)  21 (10, 1) (20, 99, 101) (420, 2079, 2121) (5, 2) (20, 21, 29) (420, 441, 609)  35 (6, 1) (12, 35, 37) (420, 1225, 1295) (3, 2) (12, 5, 13) (420, 175, 455)  105 (2, 1) (4, 3, 5) (420, 315, 525)Table 7
Nonprimitive Pythagorean triples with common lega=420 for each even value of d.
d ( n ,  m ) Primitive Triple Non-primitive Triple 4 (53, 52) (105, 5512, 5513) (420, 22048, 22052) (19, 16) (105, 608, 617) (420, 2432, 2468) (13, 8) (105, 208, 233) (420, 832, 932) (11, 4) (105, 88, 137) (420, 352, 548)  12 (18, 17) (35, 612, 613) (420, 7344, 7356) (6, 1) (35, 12, 37) (420, 144, 444)  20 (11, 10) (21, 220, 221) (420, 4400, 4420) (5, 2) (21, 20, 29) (420, 400, 580)  28 (8, 7) (15, 112, 113) (420, 3136, 3164) (4, 1) (15, 8, 17) (420, 224, 476)  60 (4, 3) (7, 24, 25) (420, 1440, 1500)  84 (3, 2) (5, 12, 13) (420, 1008, 1092)  140 (2, 1) (3, 4, 5) (420, 560, 700)Repeat the process for other values ofd to obtain the triples shown in Table 7.We see, from Tables5–7, that there are 8 primitive and 32 nonprimitive Pythagorean triples with 420 as a common leg.


## 3. Conclusion

Propositions1 and 2 define infinitely many pairs of primitive Pythagorean triples that have identical legs. It remains an open problem for one to extend the formulas in these propositions and generalize for any n number of primitive Pythagorean triples which have identical legs.Proposition6 presents a simple technique of finding all the primitive and nonprimitive Pythagorean triples associated with a given value, the leg of a Pythagorean triple. This makes it easy to classify Pythagorean triples, with respect to the values of the legs, and investigate different properties that might be of interest to a researcher. For instance, one can easily classify Pythagorean triples by considering the divisibility of legs by any positive integer or legs of Pythagorean triples that satisfy some sequences, among many other properties.



---

*Source: 4286517-2019-04-01.xml*