Ancient Greek Number Theory
Transcript
Alright, good afternoon. I'm Norman Wildberger at the University of New South Wales, and in this course on the history of mathematics, today we're going to talk about Greek number theory. That means ancient Greek number theory, and we're going to cover a number of interesting topics. We're going to talk about some special numbers including, well, square numbers, triangular numbers, prime numbers (which are particularly important),
and also perfect numbers. We're going to talk about a very important algorithm, the Euclidean algorithm for greatest common divisors, and we'll talk about Pell's equation and the cattle problem of Archimedes. Maybe I'll say a little bit about continued fractions also. Alright, so while the ancient Greeks were mostly concerned with geometry, they also made important advances in number theory. Number theory is really
a glorified term for arithmetic. We're really interested in arithmetic with natural numbers, and of course that's been going on for a long time, much earlier than just the ancient Greeks. But if you do a lot of arithmetic with natural numbers, you start noticing some pleasant patterns and interesting numbers come up, and it's interesting to study some of these things. The subject is closely connected with mystical aspects; numbers have often had an almost
religious or mystical effect on people. Certain numbers are lucky, certain numbers are unlucky, and so on. Some of the early work no doubt had a kind of mystical overlap. So, for example, some of the first numbers that were investigated are, for example, square numbers. A square number is simply a number that you get by looking at a square. Say, one, two, three, four, five. One, two, three, four, five. So there's a square number.
In this case, 25, which is five squared. One of the things that the ancient Greeks realized is that you could think about the square as being decomposed into a bunch of successive layers. So you can think of this first square here as perhaps the starting point. Then we have an L-shaped region of three different squares; they called such an L-shaped region a gnomon. There's another gnomon with five elements, and then another one with seven elements, another one with nine
elements. From this, we can quickly see that 25 is also one plus three plus five plus seven plus nine. And that pattern obviously generalizes: the sum of the first odd numbers is always a square. Other numbers that were related to geometry they were interested in. Another kind of number is a triangular number, and we can represent triangular numbers, say, with dots. So, one is a triangular number, and three is a triangular number; it forms a triangle. Then we have three on the base, and then two, and then one, so that would be six. It's a triangular number. And then the base of four,
three on top, two, and one, that's ten. And we keep going; these are triangular numbers. They also have another way of thinking about them: if we put them on the side, we can say look at something like ten and think of it as being four plus three plus two plus one. So there's ten, another version of the triangular number ten, which makes it obvious that it's equal to one plus two plus three plus four. So the triangular numbers are the numbers which you get by summing up the first n numbers, and a relatively easy formula for that
can be obtained by thinking about what happens if you double that. So if I add, maybe in blue here, alright, there's another one, and then there's two, and then there's three, and there's four. Okay, this thing here—2, 3, 4, 1, 2, 3, 1, 2, 1—is exactly another copy of the same thing. When we do it like that, we see that this triangular number, which maybe we could call T for the fourth triangular number, if we take 2 times it, 2 times T4, we are going to get a rectangle. The
rectangle has sides 4 and 5, so 2 times T4 is 4 times 5, giving us T4 equals 4 times 5 over 2. That's not that interesting when T is 4, but it's much more interesting if T is a bigger number because it applies equally. So, for example, if you want to sum all the numbers from 1 to 100, you recognize, well, that's just a triangular number. It's the same kind of picture except that it's much bigger, and exactly the same reasoning will tell us that T100 is going to be equal to the area of a rectangle of sides 100 times 101 over 2, and that's equal to 5050.
That's a computation. I think the story goes that Gauss may have done that in his head when he was a young lad in some classroom and impressed his teacher that he was able to just sort of figure out how to do it without actually having to add up all the numbers. So that's an important formula for triangular numbers. Of course, the general formula is that T of N equals n times n plus 1 over 2. Those numbers are quite important in mathematics, but they still have something of a recreational aspect. Much more important for the history of mathematics are the prime numbers.
Prime numbers are those natural numbers with no factors or no divisors other than one and themselves. For example, a number like 18 is equal to 2 times 9 as well as 1 times 18, so this is not prime because it has factors. The factors are 1, 2, 9, and 18. However, 19 can only be written as 1 times 19; those are the only factors, so this is prime. A list of primes is both intriguing and somewhat regular, but also somewhat irregular. So, 2, 3,
5, 7, 11, 13, 17, 19, 23, 29, 31, 33, 35, 37, 41, blah blah blah. They get a little bit sparser as we get out. There's quite a lot of them between, you know, one and a hundred, but as we keep going, they get a little bit more rare. But one of the great accomplishments of Euclid or ancient Greek mathematics was to realize that there were an infinite number of primes.
Books seven to nine of the Elements were concerned with number theory. Books one to six were more or less geometry, and books seven to nine were number theory. By the way, here's another edition of Euclid's Elements. This is also a famous edition. It's a three-volume set published by Dover, so it's relatively cheap, and it's got an introduction and commentary—very valuable commentary—by Sir Thomas Heath,
who was a great Greek scholar and has lots of interesting things to say about how he interprets all the theorems and gives historical background. Very, very, very beautiful. So, I can state a very important theorem that the ancient Greeks realized about prime numbers. The main fact about prime—not, well, one of the main facts about prime numbers.
So, here we are: Proposition 20 of Book 9. It's important and interesting to understand the statement of it, so let's write it down exactly as translated here in English: "Prime numbers are more than any assigned multitude of prime numbers." "Prime numbers are more than any assigned multitude of prime numbers." What does Euclid mean by this? Well, in present-day treatments, this is usually rephrased in a kind of modern way. The modern rephrasing of this is that the set of prime numbers is infinite. That
would have jarred with the ancient Greeks because they did not like to think in terms of infinite sets. They would rather have said that the sequence of prime numbers does not stop; it keeps going. So, this sequence here does not stop. It's not the case that there is some biggest prime number and that after that they are all composite. This list keeps on going and going and going. The Greeks liked to think of infinity as sort
of just keeping on going beyond the view—keep going and keep going, never getting to the end. His proof is elegant and clever. And what is the proof? Well, suppose there were only a finite number of primes. Let's say P1, P2, up to Pn for some n. Suppose that there are only a trillion primes. Okay, so we're going to try to arrive at a contradiction from this. We've got to try to show this is actually impossible. So what Euclid does is he says,
"Alright, let's consider a new number, a much bigger number." So consider the number—let's call it a capital N. We should use capital N because it's not necessarily a prime. Let's use capital N and consider capital N, which is the product of all these numbers: P1 times P2 times all the way up to Pn plus 1. The product of all the primes in our list added to 1. This number, N, is not divisible by any prime Pi, any of our primes. It's not divisible by
that prime because if you divide it by Pk, you get a remainder of 1. It's one more than a multiple, so if you divide it by that prime, you're going to get a remainder of 1. This means it doesn't divide evenly. So if you look at the factors of this thing, there are sort of two possibilities.
So, what are the factors? What are the possible factors? Well, one possibility is that N itself is prime. That would contradict the fact that all the primes are P1 to PN because this is obviously a new prime. It's obviously bigger than all of the numbers P1 through PN, right? So, this is impossible since it's not on the list. We're assuming we've got primes P1 through PN. The other possibility is that N is composite, but then it must have some prime factors itself. Any prime factor is a new prime not on the list.
So, either way, we get some new primes. Either N itself is a new prime, or one of its factors is a new prime. So, that's the end of the proof. Now, we're kind of using some facts here that Euclid knew. The most important fact about primes, the fundamental theorem of arithmetic, is sometimes called this, also goes back to Euclid. It is that every natural number can be written as a product of primes in essentially one way.
Up to rearrangement or up to order. This is a very important fact about numbers. Every number can be written as a product of primes. So, for example, 612. If I look for factors, well, it's obviously even, so it's going to have 2 as a factor. So, I divide by 2 and get 306. That's still even, so now I write it as 2 times 2. Dividing this thing gives 153. Is 153 prime? No, it has some factors. I can divide that by 3, so it's 2 times 2 times 3. Dividing that by 3 gives
51. And 51 is also divisible by 3. If the sum of the digits is a multiple of 3, then the number is divisible by 3. So, we can write it as 2 times 2 times 3 times 3. Dividing 51 by 3 gives 17, and now we can't keep going because those are all primes. We've written it out as a product of 5 primes. If somebody else started with some other way, they would still end up with these five primes, but perhaps in a different order. Whenever you factor a number, the prime decomposition you get is always the same. That's the fundamental theorem of arithmetic.
This is a very important theorem, and the proof requires some careful bookkeeping and preliminary number theory. We're not going to do the proof, but in a course on number theory, this is one of the first things you do. There were some other interesting numbers that the ancient Greeks were interested in, called perfect numbers. What is a perfect number? Well, it's a number that you get by looking at all the divisors. Suppose we take a number like
12 and consider all its divisors. These are just numbers that divide 12, so they are 1, 2, 3, 4, 6, and 12 itself. A number like 7 would have divisors 1 and 7. A number like 6 has divisors 1, 2, 3, and 6. A number like 28 has divisors 1, 2, 4, 7, 14, and 28. Now, there's something special about 6 and 28. They are perfect numbers according to the ancient Greeks. Why so? A perfect number is one where the sum of all its divisors, excluding itself,
equals the number itself. So, for 6, 1 plus 2 plus 3 (all the divisors less than 6) equals 6. For 28, 1 plus 2 plus 4 plus 7 plus 14 equals 28. Those are perfect numbers. While 12 would not be a perfect number because 1 plus 2 plus 3 plus 4 plus 6 is 16, which is not equal to 12. That is not a perfect number. And 7 is not a perfect number because 1 is not equal to 7.
So, the Greeks liked perfect numbers, and they proved a lovely thing which is actually the culminating theorem in Book Nine. This is perhaps the pinnacle of Greek work on number theory. It's Proposition 36 in Book Nine. It's a little bit long, so let me read it and then state it:
"If as many numbers as we please, beginning from a unit, be set out continuously in double proportion until the sum of all becomes prime, and if the sum multiplied into the last makes some number, the product will be perfect." What is he saying? In modern notation, he's saying if you start off with one and you double it, double it again, and keep going until the sum of all becomes prime, then the product of
the sum and the last number in the sequence will be perfect. So, let's have a look at this. For example, one is not considered a prime number, but one plus two certainly is a prime number. That's prime, and therefore, Euclid would say if you take that sum (one plus two) and multiply it by two, you get six. That's perfect.
What's another example? How about one plus two plus four? Is that prime? Yes, it is. So, if you take one plus two plus four and multiply it by four, you get 28. That's perfect. How about one plus two plus four plus eight? That's 15, which is not prime, so that's not going to work. But the next one, 31, is prime. So, the sum (one plus two plus four plus eight plus sixteen) times sixteen is perfect.
You might say, "Wait a minute, didn't the ancient Greeks know about geometric progression?" Yes, they did. This is a geometric progression. We know how to sum that. What is one plus two plus two squared plus two cubed all the way up to two to the n minus one? Well, it's the next term in the expansion, which is two to the n minus one divided by two minus one. The ratio is 2, so this sum is just two to the n minus one. So, this number that's appearing here can be
rewritten more efficiently as 2 to the N minus 1 times 2 to the N minus 1. We could state it another way: if 2 to the N minus 1 is prime, then 2 to the N minus 1 times 2 to the N minus 1 is perfect. That's just a restatement of Euclid's theorem.
What numbers of the form 2 to the N minus 1 are prime? Well, that's an interesting question. Those primes are particularly interesting and are called Mersenne primes. Not every number of the form 2 to the N minus 1 is prime; for example, 15 isn't, but quite a reasonable number of them are. When people look for primes, there are certain reasons why these kinds of primes are easier to find than others. Finding primes is, in fact, not as easy as one might think.
Euclid's prescription for multiplying a whole bunch of primes together and adding one, and then factoring it, is practically impossible if you already have billions of primes. Although it's theoretically available, you can't generate new primes this way in practice. Finding ever-higher primes is an interesting undertaking that many people on the internet spend a lot of time doing. The current world record, at least from the site I checked,
was set in 2008. The largest known prime number is 2 to the 43,112,609 minus 1. It's a number with about twelve million digits if you wrote it out. Humanity does not know any primes bigger than that, and there's no easy way of finding primes bigger than that. You have to work a lot and get your computer to do a lot of work to find any prime bigger than that. As you can see, it has already been a couple of years, and people haven't improved on it.
This kind of number theory was, for many centuries, considered a sort of frivolous entertainment and only a sort of abstract game for mathematical types. But in the last few decades, thinking about primes has become very important with the internet and security issues. These days, we have encryption methods to encrypt your bank details when you send them on the internet. These bank details are encrypted by some number theory that relies often crucially on prime numbers. One property of prime numbers that's crucial here is that using primes you can find out a fact that nobody else can. How do you find a fact that nobody else can crack? What you do is you go
to your favorite program like Maple, MATLAB, or Mathematica. These are programs that help us do mathematics, and you churn out a command that's something like this: next prime, then you write down some random number. If I type that into Maple and click it, half a second later it will tell me what the next prime is after that. Maple has no problem finding the prime bigger than that one, the next prime bigger than that one.
So I could do this twice. I could take this and then I can take the next prime of some other number. Now I've got two primes, P1 and P2. Then, I multiply those two numbers together and offer a million-dollar reward for anybody who can factor that number. If I have chosen these numbers reasonably big, then you're not going to be able to factor that number, even if I advertise it. I'm going to be the only one, or you're going to be the only one, who knows what the factors are. They happen to be P1 and P2, which you've written down on a piece of paper, but nobody else can figure that out, even if they work hard and use all kinds of computing power.
It's that fact, that there's something you can know that nobody else can know, that is the key to encryption. You exploit that to send secret messages and to decode them. Prime numbers are, in fact, quite important these days. Worrying about big numbers, worrying about big primes, worrying about factorization, it's something that security analysts and military types are very interested in. Now, I want to tell you about a very important Euclidean algorithm. Suppose we have two numbers, and we'll illustrate this with an example. Suppose I have the number 612 and 93. I've already told you that 612 is 2 times 2 times 3 times 3 times 17. Now, we could factor this one: this is 3 times 31, somewhat random numbers. Here are the prime decompositions of these numbers. What is the greatest common divisor? The greatest common divisor of 612 and 93 is the largest number
that divides both of them. In this case, it's easy to see what the greatest common divisor is because we just look through here and see how well they match. They have 3 as a common divisor. So, in this case, it will just be equal to 3, the biggest divisor that they both have in common.
But suppose I asked you to find the greatest common divisor between these two numbers without the prime factorizations. If you wanted to try this idea, you'd have to factor these numbers into primes first, and that might be very hard without a computer. You would have a hard time doing that manually. Before computers were around, how would you find the greatest common divisor of two big numbers like this? Well, that's an important problem that the ancient Greeks thought about, and there's this very important algorithm that Euclid devised.
Here's what you do. Here's the algorithm, and we'll demonstrate it on 612 and 93. It's one of the first cases of an algorithm, a sequential step that actually accomplishes something in a very logical, systematic way. We take the biggest number and we divide it by the smaller number. So you divide it, and you're going to get a remainder. 612 is equal to 6 times 93 plus a remainder of 54.
And now the key observation is, we started with this number and this number. Those were the two numbers we started with. We want to know what their greatest common divisor is. The key observation is now that the greatest common divisor is going to be the same as the greatest common divisor between these two numbers. Any number that divides these two is also going to divide this one. If this is divisible by 17 and this is divisible by 17,
then 17 will divide this whole right-hand side, and so it will divide this. So, the problem of finding a greatest common divisor is now reduced to a smaller problem, namely the problem of finding the greatest common divisor of these two. That's the same problem but with smaller numbers. So we're just going to iterate. Okay, what was it that we were doing? We were taking our number and dividing it by the other one. So, 93 divided by 54 is 1 times 54 plus 39.
Now, the greatest common divisor between 93 and 54 is the same as the greatest common divisor between these two. Same argument. So we repeat. We divide 54 by 39. We get 1 times 39 plus a remainder of 15. Then we divide 39 by 15: 2 times 15 plus a remainder of 9. Then 15 is 1 times 9 plus a remainder of 6. Finally, 9 equals, maybe not finally, 1 times 6 plus a remainder of 3. And finally, we get to the stage where 6 is equal to 2 times 3 with a remainder of 0.
So the greatest common divisor between 6 and 3 at this stage is 3 because 6 is a multiple of 3. Once you have a remainder, it means that one is a multiple of the other, and so the smaller number is the greatest common divisor. This last remainder that we got, that is the greatest common divisor. This is perhaps the world's first algorithm, and it's a much more efficient way of calculating the greatest common divisor of two big numbers rather than factoring them. We'll take a break there.

Ask anything
We've read this whole study set, so questions about it get the best answers.