Sei sulla pagina 1di 17

Unique Sums of Pythagorean Triples

Christopher Edward Phifer


December 5, 2013

Contents
1 Acknowledgments
2 Purpose and Hypothesis
3 Review of Literature
3.1

Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.2

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.3

The Generation of Triples . . . . . . . . . . . . . . . . . . . .


3.3.1

Proof 1: All h, k Yield a Triple . . . . . . . . . . . . .

3.3.2

Proof 2: All Triples Obtainable from h, k . . . . . . . .

3.4

Generating Triples 10000 . . . . . . . . . . . . . . . . . . .

3.5

Algebraically Representing Sum . . . . . . . . . . . . . . . . .

3.6

Initial Conclusions: Parity of All S Values . . . . . . . . . . .


3.6.1

3.7

Proof 3: Evenness of Triples . . . . . . . . . . . . . . .

Analysis of the Algebraic Sum Expression . . . . . . . . . . .

4 Materials, Procedure
5 Results, Conclusions, Dead-Ends
6 Bibliography

Pythagorean Triples, Phifer

Acknowledgments

Thank you to the creators of Project Euler for creating a website full
of stimulating problems for programmers both young and old. Thank you
also to Mr. Karafiol, for all of your support in approaching the problem
and looking at it in new ways. Finally, thank you to my family for all of
your contributions, including a quiet environment in which to work, and the
materials necessary to effectively study.

Pythagorean Triples, Phifer

Purpose and Hypothesis

The purpose of this investigation was to explore not only number theory, but
the power of computation and an interesting, seemingly unsolved problem
regarding those most famous of triples, the Pythagorean triples.
I hypothesized that it would be somewhat difficult to find a formula or prove
a theorem that allowed the prediction of whether or not a given sum of a
triple will be repeated at some point, and that finding intriguing bounds
would be the most interesting conclusion.

Pythagorean Triples, Phifer

3
3.1

Review of Literature
Abstract

The goal of this research was to explore number theory with regards to one
of the most famous theorems of all time: the Pythagorean theorem. In
particular, it was hoped that a general solution to the problem of unique
sums of primitive or even non-primitive triples would be found. Rather than
an elegant, complete solution, interesting boundaries and limitations can be
placed on the components that make up the sum itself, meaning there is room
for further study into these boundaries turning the solution into a potential
theorem. The results are an inspiration in of themselves, encouraging a
desire to learn more about the natural numbers and the intricacies of the
inner workings of arithmetic.

3.2

Introduction

The problem of Pythagorean triple sums arose while perusing the Project
Euler website in search of a programming challenge:
Special Pythagorean Triple
Problem 9
A Pythagorean Triple is a set of three natural numbers, a, b, and
c, for which a2 + b2 = c2 .

Pythagorean Triples, Phifer

There exists only one Pythagorean Triple for which a + b + c =


1000.
Find the product a b c.
[3]
This is a fairly trivial programming problem, requiring only two main components: a generator that is efficient in both computation and run time, and
conditional logic to find the particular solution. This, as it is stated, is uninteresting. A much more thought provoking question is When is the sum
of a, b, and c unique, when the sum is less than or equal to 10000? The
technique utilized to attack this problem was an adaptation of the original
computer program, modified to generate an arbitrary number of triples, find
their sum, and filter the unique results by generator values and sum. While
the results were at first glance inconclusive in a general sense and challenging
to comprehend without a more in depth knowledge of number theory, interesting boundaries and restrictions presented themselves as useful topics for
further study.

3.3

The Generation of Triples

Familiar with a number of triple generating methods [2] [4], the first attempt
was a mess of inefficiency despite its compact nature. (It was O(n2 ) due to
the nesting of two for-loops checking every possible a and b). The second
algorithm was written with the value of b depending on the value of a; one

Pythagorean Triples, Phifer

initial assumption was that b > a, so from the beginning the initial value of b
checked could be a + 1. This reduced the algorithm to linear time, but upon
further analysis was fairly useless in terms of generalization and the patternsearching aspect of the problem. This led to the picking of an entirely new
algorithm, based on the work of Euclid. The theorem states that:
For any two integers, h and k, such that h > k, a Pythagorean
triple a, b, and c can be generated by the following equations [1]:

a = h2 k 2

(1)

b = 2hk

(2)

c = h2 + k 2

(3)

The generation method can be further specialized, as the above scheme does
not guarantee the generation of a primitive triple (that is, a triple with a,
b, and c picked to be relatively prime). In order to guarantee that they are
primitive, conditions must be put on the seed values:
To generate a primitive triple, pick h and k such that they are
coprime, one but not both are odd, and the difference is odd. From
here, to generate the remaining non-primitive triples, insert a
third seed value, so that the equations are now: [1]:

a = m h2 k 2

(4)

Pythagorean Triples, Phifer

b = m (2hk)
c = m h2 + k 2

(5)


(6)

This was the key algorithm, but it was not convincing upon discovery and
encouraged an original proof, in order to validate the results.

3.3.1

Pf 1: Every h,k Under the Conditions Yields a Pythagorean


Triple

First, a proof that the given expressions evaluate to a valid Pythagorean


Triple:
2

Under the given definitions, a2 +b2 = c2 is equivalent to (h2 k 2 ) +(2hk)2 =


2

(h2 + k 2 ) . The latter equation leads to h4 (2h2 k 2 ) + k 4 + (4h2 k 2 ) =


h4 + 2h2 k 2 + k 4 upon expansion, and is finally simplified to h4 + 2h2 k 2 + k 4 =
h4 + 2h2 k 2 + k 4 , which validates the claim that the left side is equal to the
right. QED.
However, this only demonstrates that the given expressions are valid triples;
not that the Pythagorean theorem necessitates that all possible values of a, b,
and c are able to be expressed in this way. To prove that these are necessary
conditions, we assume gcd(a, b, c) = 1 (they are coprime). As a result, b and
c cannot both be even or both be odd; if all terms are even, then smaller
terms a2 , 2b , and

c
2

can be found. If all are odd, an odd is being equated to

an even. Symbolically, these lemmas can be demonstrated as follows:


Take o, p, q R. Let us assume that a, b, and c are all even and a solution

Pythagorean Triples, Phifer

to a2 + b2 = c2 . Respectively, they are of the form 2o, 2p, 2q, by definition of


evenness. Therefore, a2 + b2 = c2 (2o)2 + (2p)2 = (2q)2 . Upon expansion,
we see that a2 + b2 = c2 4o2 + 4p2 = 4q 2 which clearly shows that smaller
terms a2 , 2b , and

c
2

can be found since a factor of four is common.

Take now the case where a, b, and c are odd, and of the forms 2o + 1, 2p + 1,
and 2q + 1 (by definition of odd) respectively. We now have a2 + b2 =
c2 (2o + 1)2 + (2p + 1)2 = (2q + 1)2 . Expanding the right side gives
4o2 + 4o + 4p2 + 4p + 2 = 4q 2 + 4q + 1. This result is nonsensical, as the
expression on the left is even while that on the right is odd, as seen by the
lefts common factor of 2.

3.3.2

Pf 2: Every Pythagorean Triple is Obtainable from an h, k

Having proved those preliminary lemmas, we now proceed to manipulate our


expression a2 + b2 = c2 as follows:
b2 = c2 a2 b2 = (c + a)(c a)
integers are closed under addition,

c+a
b

c+a
b

b
.
ca

Because a, b, c Z and the

is a rational number; call it

h
k

such

that gcd(h, k) = 1 (i.e. is in lowest terms). By the equality shown above,


b
is the reciprocal of ca
. In other words, ca
= hk . This
b


gives the system of equations c+a
= hk , ca
= hk . Solving for the rational
b
b

the reciprocal of

expressions

c
b

c+a
b

and

a
b

in terms of h and k gives

c
b

h2 +k2
2hk

and

a
b

h2 k2
.
2hk

The

proof is nearly complete; we can only equate numerators and denominators


if all fractions are in lowest terms. Recall that a, b, and c are coprime,
and

h
k

is in lowest terms; it is immediately evident that h and k are not

Pythagorean Triples, Phifer

both even, as otherwise they would both be divisible by 2. Similarly, it has


already been shown that a case where both values are odd does not work as
it nonsensically equates an odd value to an even value. Therefore, it can be
concluded that equating the numerators and denominators is allowed, and
the Euclidean generator expressions have been shown as both sufficient and
necessary conditions for all possible Pythagorean triples. QED.

3.4

Generating the Pythagorean Triples with Sum Less


Than or Equal 10000

Recall the original question: What sums of a, b, and c are unique, when the
sum is less than or equal 10000? Given this, it was necessary to put special
conditions and bounds on the relevant variables in the generator, in order to
meet the requirements set forth by the problem.
As stated in the proof, only very specific pairs h and k are allowed in the
generators expressions. One but not both of them is odd, their difference is
odd, and they are (consequently) coprime. Rather than complicating things
further and introducing non-primitive triples, only primitives were considered
and the extra variable stated above left out altogether. This allowed for an
easy manual filtration of all the repeated sums from the list. The only other
condition required was a statement guaranteeing that that condition was
met. All of these conditions prove useful later on in the examination of the
triples, and altogether up to this point they are:

Pythagorean Triples, Phifer

10

h and k are greater than or equal to 1


h and k are coprime (one is odd and one is even)
h>k
h k is odd (consequently, h + k is also odd)
The first and last points in particular are incredibly useful in approaching a
general solution to the uniqueness problem, as they allow an analysis of the
algebra of the sums themselves.

3.5

Algebraic Representation of the Sum Problem Given


Euclidean Expressions

Recall that any primitive Pythagorean triple can expressed by the following
expressions:

a = h2 k 2

(7)

b = 2hk

(8)

c = h2 + k 2

(9)

where h, and k are both integers greater than or equal to 1, h > k, gcd(h, k) =
1, and hk is odd. This means that the sum of a, b, and c can be expressed as
h2 k 2 + 2hk + h2 + k 2 After algebraic simplification, this becomes 2h(h + k).
This gives a symbolic representation that can validate the results gained

Pythagorean Triples, Phifer

11

from the algorithm; it also provides the first steps necessary in attacking the
general unique sum problem. From here on, let S be the sum of the triple
(S = 2h(h + k)) for the sake of convenience.

3.6

Initial Conclusions: Parity of All S Values

A simple but interesting observation that is a consequence of the algebraic


sum formula in terms of h and k tells us more about the value of S than
might be expected.

3.6.1

Pf 3: All Pythagorean Triples Sum to an Even Number

It is known that S = 2h(h + k). All of the variable quantities in this equality
are integers. Upon applying the distributive property, we obtain 2(h2 + hk).
As it is known that the integers are closed under addition and multiplication,
it is true that h2 + hk can be expressed as a single integer, say l. Therefore,
it can be concluded that S is always of the form 2l, meaning that it is always
even based on the definition of an even number. QED.

3.7

Analysis of the Algebraic Sum Expression

Analysis of the generated triples that do for certain have unique sums was
mostly futile except for the previous result that all sums, unique or otherwise,
are even. This led to analysis of the inverse problem rather than continuing
to pursue something with no apparent end. This problem reads as follows:

Pythagorean Triples, Phifer

12

What sums are never possible, or which have at least two triples associated
with them?
Consider again the equation S = 2h(h + k). Rearranging this gives

S
2

h(h + k). This being quadratic, there should be two solutions in h and k for
S
.
2

In other words,

S
2

has two distinct factorizations of the form h(h + k). As

has already been determined, the value of h + k must be odd, as they are
coprime. It is also known that both h and k are positive values, meaning
immediately that h + k must be greater than h. Take a particular example
that doesnt appear in the list (in other words, it isnt unique). Let S = 6144;
it follows that

S
2

= 3072. This value needs to be factored into two numbers,

one even (h) and one odd (h + k). By this, h = 210 and h + k = 3, because
making h any smaller power of 2 leaves h + k even. This clearly goes against
the criterion established previously. Another example, slightly simpler, is
when S = 108. This gives that

S
2

= 54. In this scenario, h = 2 and

h + k = 33 . Though this seems viable, recall that h > k and as a result,


h2 k 2 > 0. In this scenario, k  h, making the result nonsensical.
This leads to some general scenarios, based on whether h or h+k contains all
of some prime factor p to some power, n, of S2 . In symbols,

S
2

= pn (l) | p = 2,

where h is the power of 2, l is odd, and h + k is this odd number. The other
scenario is

S
2

= (l) pn where h is the odd number l and the odd prime power

is h+k. The question after this analysis becomes what bounds can be put on
these prime factors? The first example suggests that when h contains all of
the factors of 2 in the halved sum, if the number of those factors is too large,

Pythagorean Triples, Phifer

13

the value of h + k will be much smaller than that of h, which is nonsensical


based on the criteria. As seen by the second scenario, the original restrictions
on h and k are challenged when h is a very small number compared to h + k.
The other scenario to consider is those sums which are not unique; analysis of these triples and their generator seed values revealed some common
patterns, though none seem mathematically justifiable at first glance. For
instance, it seems that having either h or h + k equal to 58, 69, 75, 87, and
some other values always produce non-unique sums. Further research into
why this happens is necessary, as there is no clear number-theoretical reason
why this occurs.
Setting these bounds is a very challenging problem requiring more number theory than was available; though this discovery is fascinating, it became
a dead-end very quickly. Figuring out how many factors is too many, or when
h + k is going to be too large, is very difficult and worth exploring more as
analysis of the original problem continues.

Materials, Procedure

All materials used in this project were technology based; the Python programming language, a text editor, and a command-line interaction interface.
There is no true list of physical materials to report.
To conduct this design project, the standard design procedure for an algorithm was used: the problem was identified, based on given conditions and

Pythagorean Triples, Phifer

14

desired unknowns. A computer program capable of producing and organizing the data was developed based around the principles of the problem (see
Abstract/Review of Literature). This data was analyzed using mathematical principles, and conclusions were drawn based on the data and patterns
found.

Results, Conclusions, Dead-Ends

As a result of the analysis of primitive Pythagorean triples and their sums, a


few conclusions can be made regarding how to algebraically generalize these
sums and determine when they will be unique:
As a result of the Euclidean generation method, the sum of any Pythagorean
triple can be represented by 2h(h+k); this number will always be even,
h will always be less than h + k, and h + k will always be odd.
Two scenarios arise: h is even, containing all of the factors of two while
h + k is an odd number, or h and h + k are odd, where h + k contains
all of the factors of some prime number other than 2.
Sums that are not possible come when h is too much less than h + k,
making k larger than h, or when the number of factors of 2 is so high
that h far exceeds the value of h + k.
Sums that appear more than once arise when certain values of h or h+k
are observed; some commonalities were 58, 69, 75, and 87. Whenever

Pythagorean Triples, Phifer

15

these appeared in pairs, problems arose in generating a unique sum (it


essentially never happened).
These results, while fascinating, are dead-ends as the number theory required
to properly analyze them is beyond the scope of the research done. They pose
very fascinating problems for future research, encouraging a further study
into the field and better understanding of all the mathematics involved.

Pythagorean Triples, Phifer

16

Bibliography

References
[1] The Wikipedia Foundation. Pythagorean Triples. 2013. url: http://
en.wikipedia.org/wiki/Pythagorean_Triples.
[2] M. Makarious and R. Rosborough. Patterns With Pythagorean Triples.
In: The Mathematics Teacher 93 (5 2000), p. 363.
[3] Project Euler Problem 9. 2002. url: http : / / projecteuler . net /
problem=9.
[4] D. Watson and J. Comella. Pythagorean Triples: What Kind? How
Many? In: The Mathematics Teacher 69 (2 1976), pp. 108110.

Potrebbero piacerti anche