General formulas for Pythagorean Triples

NEW GENERAL FORMULAS FOR PYTHAGOREAN TRIPLES
EDUARDO CALOOY ROQUE
Abstract. This paper shows the General Formulas for Pythagorean triples that were derived from
the differences of the sides of a right triangle. In addition, as computational proof, tables were made
with a C++ script showing primitive Pythagorean triples and included as text files and screenshots.
Furthermore, to enable readers to check and verify them, the C++ script which will interactively
generate tables of Pythagorean triples from the computer console command line is attached. It can
be run in Cling and ROOT C/C++ interpreters or compiled.
1. Introduction
I believe it would be best to proceed immediately to the problem at hand, i.e. to find general
formulas for Pythagorean triples, rather than discuss many things and go in circles. So going
straight to the point we will derive and prove the relevant theorem then derive from it the formulas
given by the Greeks, Plato and Pythagoras. Then we will show the general formulas that generates
Pythagorean triples. At this point, the pattern will manifest. Next we will provide tables from a
C++ script to demonstrate validity. In conclusion, i attached the C++ script instead of typesetting
verbatim so that the document will not look unnecessarily large.
2. Pythagorean Triples
Definition. If a, b, c ∈ N and a < b < c or b < a < c then a Pythagorean triple is a triple of natural
numbers such that a2 + b2 = c2 . It is said to be primitive if (a, b, c) is pairwise relatively prime and
the parities of a and b are always opposites while c is always odd.
Theorem 1. If (a, b, c) is a Pythagorean triple then there exists α, β, γ ∈ Z, k, n ∈ N where
α = b − a, β = c − a, γ = c − b, β = α + γ, k = n, n = 1, 2, 3, . . . such that
(a − γ)2 = 2γβ
γβ = 2k2
a = γ + 2k
b = β + 2k
c = γ + β + 2k
Date: November 21, 2012.
1
2
EDUARDO CALOOY ROQUE
Proof.
a2 + b2 = c2
a2 + (a + α)2 = (a + β)2
a2 + (a2 + 2aα + α2 ) = a2 + 2aβ + β2
a2 + 2a(α − β) = β2 − α2
a2 − 2a(β − α) = (β + α)(β − α)
a2 − 2γa = [(α + γ) + α]γ
(a − γ)2 = γ(2α + γ) + γ2
(a − γ)2 = 2γ(α + γ)
∴ (a − γ)2 = 2γβ
It is evident that (a − γ)2 = 2γβ has even parity and hence of the form 4k2 where k, n ∈ N, k =
n, n = 1, 2, 3, . . . Thus (a − γ)2 = 4k2 and γβ = 2k2 . We now see that a = γ + 2k. Now
β − α = (c − a) − (b − a) = c − b. This is γ thus α + γ = β. From b − a = α we get b = a + α = β + 2k
and since c − b = γ we also get c = b + γ = γ + β + 2k.
Theorem 2. If (a, b, c) is a Pythagorean triple then there exists α, β, γ ∈ Z, k, n ∈ N where
α = b − a, β = c − a, γ = c − b, β = α + γ, (a − γ)2 = 2γβ, γβ = 2k2 , k = n, n = 1, 2, 3, . . . such
that
γ = 1, β = 2k2 , a = 2k + 1
b = 2k(k + 1)
c = 2k2 + 2k + 1
γ = 2, β = k2 , a = 2(k + 1)
b = k(k + 2)
c = k2 + 2k + 2
Proof. From Theorem1, we have β =
2k2
and so Pythagorean triples are generated by
γ
a = γ + 2k, b =
2k2
2k2
+ 2k, c = γ +
+ 2k
γ
γ
It is seen then that integral values can be obtained for γ = 1, 2. If γ = 1 then β = 2k2 and
a = 2k + 1, b = 2k(k + 1), c = 2k2 + 2k + 1.
If γ = 2 then β = k2 and a = 2(k + 1), b = k(k + 2), c = k2 + 2k + 2.
NEW GENERAL FORMULAS FOR PYTHAGOREAN TRIPLES
3
Corollary 2.1. If γ = 1, 2 then primitive Pythagorean triples are generated by
γ = 1, β = 2n2 , a = 2n + 1
b = 2n(n + 1)
c = 2n2 + 2n + 1
γ = 2, β = n2 , a = 4n
b = 4n2 − 1
c = 4n2 + 1
Proof. From Theorem2, if γ = 1, β = 2k2 then a - b, a - c, b - c and gcd(a, b, c) = 1. Thus
primitive Pythagorean triples can be found for k = n.
If γ = 2, β = k2 then we need to consider when k is even and when it is odd.
If k is even let k = 2n then a = 2(2n+1), b = 4n(n+1), c = 2(2n2 +2n+1) thus a | b, a | c, b | c
and gcd(a, b, c) = 2. Hence non-primitive Pythagorean triples are found when k is even.
If k is odd let k = 2n − 1 then a = 4n, b = 4n2 − 1, c = 4n2 + 1 thus a - b, a - c, b - c and
gcd(a, b, c) = 1. Hence primitive Pythagorean triples can be found when k is odd.
From these results the corollary is proved.
3. General formulas for Pythagorean Triples
Theorem 3. If (a, b, c) is a Pythagorean triple then there exists α, β, γ ∈ Z, k, m, n ∈ N where
α = b − a, β = c − a, γ = c − b, beta = α + γ, (a − γ)2 = 2γβ, γβ = 2k2 , k = mn, m =
1, 2, 3, . . . , n = 1, 2, 3, . . . such that
γ = m2 , β = 2n2 , a = m(m + 2n)
b = 2n(n + m)
c = m2 + 2mn + 2n2
γ = 2m2 , β = n2 , a = 2m(m + n)
b = n(n + 2m)
c = 2m2 + 2mn + n2
Proof. If n ∈ N, n = 1, 2, 3, . . . then n = 1(1), 1(2), 2(1), 3(1), 2(2), 5(1),2(3), . . . , 41(3), 31(4), . . .
We see that n can be expressed as the product of two natural numbers. Therefore if k, m, n ∈ N and
k = mn where m = 1, 2, 3, . . . , n = 1, 2, 3, . . . then since γβ = 2k2 we have γβ = 2m2 n2 .
At this point, we see that (γ, β) is {(m2 , 2n2 ), (2m2 , n2 )}. Thus by Theorem1 we get the general
formulas. Observe that if m = 1 they become the formulas in Theorem 2.
Corollary 3.1. If γ = m2 and β = 2n2 then primitive Pythagorean triples are generated if m = 1
and m > 1 where m , n, m is odd and gcd(m, n) = 1.
Proof. If m = 1 they become the formulas in Theorem 2. If m > 1 and if q, t ∈ N, q =
1, 2, 3, . . . , t = 1, 2, 3, . . . , γ = m2 , m , n, m = t then let m = 2t − 1 and we have
a = (2t − 1)[(2t − 1) + 2n], b = 2n[n + (2t − 1)], c = (2t − 1)2 + 2n[n + (2t − 1)], gcd(a, b, c) = 1.
Now let m = 2t and we have a = 4(t)(t +n), b = 2(n)(2t +n), c = 2[2t2 +2tn+n2 ], gcd(a, b, c) = 2.
If n = qm, then a = 2(1+q)m2 , b = q(2+q)m2 , c = (2+2q+q2 )m2 . We see that gcd(a, b, c) = m2
therefore considering all of these, we conclude that primitive Pythagorean triples are found if m = 1
and if m > 1, m , n, m is odd and gcd(m, n) = 1.
4
EDUARDO CALOOY ROQUE
Corollary 3.2. If γ = 2m2 and β = n2 then primitive Pythagorean triples are generated if m = 1
and m > 1 where m , n, n is odd and gcd(m, n) = 1.
Proof. If m = 1 they become the formulas in Theorem 2. If m > 1 and if q, t ∈ N, q =
1, 2, 3, . . . , t = 1, 2, 3, . . . , γ = m2 , m , n, m = t then let m = 2t − 1 and we have
a = 2(2t−1)[(2t−1)+n], b = n[n+2(2t−1)], c = 2(2t−1)2 +n[n+2(2t−1)], gcd(a, b, c) = 1. Now
let m = 2t and we have a = 2(2t)[2t +n], b = n[n+2(2t)], c = 2(2t)2 +n[n+2(2t)], gcd(a, b, c) = 1.
Since both have gcd(a, b, c) = 1 we consider n. A quick mental calculation will tell us that
gcd(a, b, c) = 2 if n is even but gcd(a, b, c) = 1 if n is odd.
If q ∈ N, n = qm, q = 1, 2, 3, . . . then a = (2 + q)m2 , b = q(q + 2)m2 , c = (2 + 2q + q2 )m2 .
We see that gcd(a, b, c) = m2 thus considering all of these we conclude that primitive Pythagorean
triples are found if m = 1 and if m > 1, m , n, n is odd and gcd(m, n) = 1.
Corollary 3.3. If a < b then n >
j
m
√
2
k
j √ k
for γ = m2 , β = 2n2 and n > m 2 for γ = 2m2 , β = n2 .
2
2
2
2
Proof.
j Ifk a < b then α > 0 and so β > γ. Thus for γ = m , β = 2n
j √wek have m > 2n which is
n > √m2 . And for γ = 2m2 , β = n2 we have 2m2 > n2 which is n > m 2 .
4. Extra
Theorem 4. If (a, b, c) is a Pythagorean triple and t ∈ N, t = 3, 4, 5, . . . then at + bt , ct .
Proof. By Theorem 1 and the Binomial Theorem we have
at + bt , ct
(γ + 2k)t + (β + 2k)t , [(γ + β) + 2k]t
!
!
!
t
t
t
X
X
X
t
t
t
(t−i)
i
(t−i)
i
(γ) (2k) +
(β) (2k) ,
(γ + β)(t−i) (2k)i
i
i
i
i=0
i=0
i=0
Thus by Theorem 3
γ = m2 , β = 2n2 ,
!
!
!
t
t
t
X
X
X
t 2 (t−i)
t
t 2
i
2 (t−i)
i
(m ) (2mn) +
(2n ) (2mn) ,
(m + 2n2 )(t−i) (2mn)i
i
i
i
i=0
i=0
i=0
γ = 2m2 , β = n2 ,
!
t
X
t
i=0
i
2 (t−i)
(2m )
!
!
t
t
X
X
t 2 (t−i)
t
i
(2mn) +
(n ) (2mn) ,
(2m2 + n2 )(t−i) (2mn)i
i
i
i=0
i=0
i
where i ∈ Z and k, m, n, t ∈ N, k = mn, t = 3, 4, 5, . . . , m = 1, 2, 3, . . . , n = 1, 2, 3, . . .
Corollary 4.1. If (a, b, c) is a Pythagorean triple then a3 + b3 , c3 .
NEW GENERAL FORMULAS FOR PYTHAGOREAN TRIPLES
5
Proof. From Theorem 4, if t = 3 then
γ = m2 , β = 2n2
a3 = m6 + 6m5 n + 12m4 n2 + 8m3 n3
b3 = 8n6 + 24n5 m + 24n4 m2 + 8n3 m3
c3 = m6 + 6m5 n + 18m4 n2 + 32m3 n3 + 36m2 n4 + 24mn5 + 8n6
γ = 2m2 , β = n2
a3 = 8m6 + 24m5 n + 24m4 n2 + 8m3 n3
b3 = n6 + 6n5 m + 12n4 m2 + 8n3 m3
c3 = 8m6 + 24m5 n + 36m4 n2 + 32m3 n3 + 18m2 n4 + 6mn5 + n6
Thus we have for γ = m2 , β = 2n2
a3 + b3 = m6 + 6m5 n + 12m4 n2 + 16m3 n3 + 24m2 n4 + 24mn5 + 8n6
c3 = m6 + 6m5 n + 18m4 n2 + 32m3 n3 + 36m2 n4 + 24mn5 + 8n6
and for γ = 2m2 , β = n2
a3 + b3 = 8m6 + 24m5 n + 24m4 n2 + 16m3 n3 + 12m2 n4 + 6mn5 + n6
c3 = 8m6 + 24m5 n + 36m4 n2 + 32m3 n3 + 18m2 n4 + 6mn5 + n6
We see that a3 + b3 , c3 in both sets. The 3rd, 4th, and 5th terms differ.
Corollary 4.2. If (a, b, c) is a Pythagorean triple then a4 + b4 , c4 .
Proof. From Theorem 4, if t = 4 then
γ = m2 , β = 2n2
a4 = m8 + 8m7 n + 32m6 n2 + 32m5 n3 + m4 n4
b4 = 16n8 + 64n7 m + 128n6 m2 + 64n5 m3 + 16n4 m4
c4 = m8 + 8m7 n + 32m6 n2 + 80m5 n3 + 136m4 n4 + 160m3 n5 + 128m2 n6 + 64mn7 + 16n8
γ = 2m2 , β = n2
a4 = 16m8 + 64m7 n + 128m6 n2 + 64m5 n3 + 16m4 n4
b4 = n8 + 8n7 m + 32n6 m2 + 32n5 m3 + 16n4 m4
c4 = 16m8 + 64m7 n + 128m6 n2 + 160m5 n3 + 136m4 n4 + 80m3 n5 + 32m2 n6 + 8mn7 + n8
Thus we have for γ = m2 , β = 2n2
a4 + b4 = m8 + 8m7 n + 32m6 n2 + 32m5 n3 + 17m4 n4 + 64m3 n5 + 128m2 n6 + 64mn7 + 16n8
c4 = m8 + 8m7 n + 32m6 n2 + 80m5 n3 + 136m4 n4 + 160m3 n5 + 128m2 n6 + 64mn7 + 16n8
and for γ = 2m2 , β = n2
a4 + b4 = 16m 8 + 64m7 n + 128m6 n2 + 64m5 n3 + 32m4 n4 + 32m3 n5 + 32m2 n6 + 8mn7 + n8
c4 = 16m8 + 64m7 n + 128m6 n2 + 160m5 n3 + 136m4 n4 + 80m3 n5 + 32m2 n6 + 8mn7 + n8
We also see that a4 + b4 , c4 in both sets. The 4th, 5th, and 6th terms differ.
6
EDUARDO CALOOY ROQUE
5. Conclusion
We have found general formulas for Pythagorean triples and shown that they are valid. A glance
between them and the formulas studied by the Greeks shows that the latter is a special case. It is
also evident from these formulas that Pythagorean triples are infinite and grouped into two infinite
sets.
As an extra, we found an application for the formulas. It was shown that they could be used
to prove that at + bt , ct for t > 3 if (a, b, c) is a Pythagorean triple. Proofs for cases, t = 3, 4
were shown indicating that higher values for t is also valid. The reason is that the terms around the
middle of the binomial expansions will always differ for all t.
A C++ script that can be run in Cling and ROOT C/C++ interpreters is attached here
instead of typesetting it verbatim.It is just a simple interactive command line interface program.
I also attached tables for γ = 1, 2, 2(2)2 , 32 , 772 , 2(772 ) with n up to 10000 here:
With hope that this humble work be of benefit to fellowmen, we conclude with these words:
Proverbs 3:13
Happy is the man that finds wisdom, and the man that gets understanding.
Proverbs 9:10
The fear of the Lord is the beginning of knowledge: and the knowledge of the Holy One is
understanding.
NEW GENERAL FORMULAS FOR PYTHAGOREAN TRIPLES
6. Screenshots of C++ script
Figure 1. S et 1 : γ = m2 , β = 2n2
7
8
EDUARDO CALOOY ROQUE
Figure 2. S et 2 : γ = 2m2 , β = n2
NEW GENERAL FORMULAS FOR PYTHAGOREAN TRIPLES
References
[1]
[2]
[3]
[4]
[5]
[6]
James Tattersall: Elementary Number Theory in Nine Chapters, (1999)
G. H. Hardy, E.M. Wright: An Introduction to the Theory of Numbers, 4th ed., (1960)
M. Richardson: College Algebra, 3rd ed., (1966)
Bjarne Stroustrup: C++ Programming Language, 3rd ed. (1997)
Rene Brun, Fons Rademakers: ROOT User’s Guide, (2007)
Vassil Vassilev: Cling The LLVM-based interpreter, (2011)
Philippines
E-mail address: [email protected]
9