Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
1 Acknowledgments
2 Purpose and Hypothesis
3 Review of Literature
3.1
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3
3.3.2
3.4
3.5
3.6
3.7
4 Materials, Procedure
5 Results, Conclusions, Dead-Ends
6 Bibliography
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.
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.
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 .
3.3
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
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)
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
c
2
c
2
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
c+a
b
c+a
b
b
.
ca
h
k
such
the reciprocal of
expressions
c
b
c+a
b
and
a
b
c
b
h2 +k2
2hk
and
a
b
h2 k2
.
2hk
The
h
k
3.4
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:
10
3.5
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
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
3.6.1
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 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:
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 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
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
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,
13
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
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.
15
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.