 This lecture is part of an online course on the theory of numbers and will be about Euclid's proof. This is Euclid's proof that there are infinitely many primes. So most people already know this proof, I'll just review it quickly. Suppose you've got a finite number of primes p1, p2, up to pn. What Euclid does is he takes the product p1, p2, up to pn and then adds one. And then we take pn plus one to be a prime divisor of this. And you notice that pn plus one is not equal to p1, p2, up to pn because if it was then it would divide one. So for any finite set of primes we can find another prime not in the set. So let's just see how this works. We start with the empty set of primes and we take the product of all primes in the empty set and the product of an empty set of numbers is by definition equal to one so we get one plus one equals two. Then our set of primes now has one element two so we take the product of them all which is just two and we get two plus one equals three then we get two times three plus one equals seven which is a new prime and then we get two times three times seven plus one equals 43 which is a new prime so we've got lots of primes here. Two, three, seven, 43 and then we take two times three times seven times 43 plus one which is 1807 and this is not prime but that doesn't matter. So what we do is we factorize it, it's equal to 13 times 39 so we get a new prime, maybe we'll take the smallest one which is 13. It seems to be a common error by people who think that if you multiply all the primes you've thought of and add one then that's always prime but as you see from this example that's not actually true in general. If you would like to see Euclid's original proof I've actually got a translation of it here. See maybe I should just if I just find this a bit so you can see it. So Euclid's proof is recognizably the same proof I give here except you know he's just doing the case n equals three. Euclid often just did the case of three numbers rather than a general case of n numbers because he didn't really have a well-defined concept of proof by induction so what he would do is he would just work out an example for three numbers and it would leave it to be sort of obvious that that worked for any collection numbers. Also he doesn't actually quite multiply them. He just says let the least number measured by a b and c b d e well measured by means divisible by so instead of multiplying them he's taking the least number that they all divide and that's because Euclid didn't really have a really good concept of multiplying several numbers together and whenever you multiply several numbers together he always has this rather some rather clumsy roundabout way of doing it. I think that's partly because he thought of numbers as being line segments and you know you can multiply two line segments together that gives you a rectangle and has an error and you can multiply three together and get some sort of solid object which has a volume but multiplying four or more together is getting a bit doubtful on geometric grounds if you think space is three dimensional. Anyway if you look at the rest of Euclid's proof it's actually more or less the same proof I gave and perhaps it's in slightly archaic terminology but it's still the same proof. So the next thing I'd better discuss a little bit is what actually is a prime. Let me turn the application down a bit. So what is a prime? Well we just recall that it's a number p that's only divisible by one and p so we're talking about positive integers and p should not be equal to one so I'm saying one is not a prime by definition so this answers the question is one a prime. The answer is no by definition. So people will sometimes argue about whether or not one is a prime. This is a kind of silly argument because it's defined not to be a prime. The real question is why is it defined not to be a prime? So why do we define one not to be prime? Because I mean the definition would be simpler if we actually missed out this condition here. Well the answer is it's more convenient. So we're defining one saying that one isn't a prime not because it's true that one isn't a prime but because it's convenient to use a definition of prime that excludes one. Let me give some examples. First of all we have unique factorization into primes. So if you've got a number like 12 it's equal to 2 times 2 times 3 and that's the only way to write it as a product of primes up to order. If we allowed one as a prime then we can write it as 1 times 2 times 2 times 3 or 1 times 1 times 2 times 2 times 3 and this would be rather annoying. So a consequence of that is you can do things like if you've got a number p and n then we can define the largest power of p dividing n. For instance if we take p to be 2 and n to be 12 then the largest power of p dividing 12 is the second power of p and it's very useful to be able to count how many number of times a prime divides an integer and again you couldn't do this if one was a prime. Third example, fairly typical example is in the introduction we mentioned the Riemann-Zeta function which is 1 over 1 to the s plus 1 over 2 to the s and so on and this is equal to a product over primes 1 over 1 minus 2 to the minus s 1 over 1 minus 3 to the minus s 1 over 1 minus 5 to the minus s and so on. And if we allowed 1 to be a prime then we would get a factor of 1 over 1 to the minus s which is 1 over 0 which is infinity which doesn't make any sense at all. So this is fairly typical of many examples where if you allow 1 to be a prime then you would just have to exclude it in your statement of a theorem. There's a sort of philosophical remark about this. We can define words to mean anything we want to mean. We just have to be clear about what the definition is. And there is no real point about arguing about the true meaning of a word because it doesn't, no word has a true meaning unless you define it. And words actually often have several meanings and a lot of arguments in philosophy turn out to be people arguing about the definition of a word except they don't realise it. For instance, people argue, there's an old question, if a tree falls in a forest and nobody hears it doesn't make a sound and people argue endlessly about this. And it's impossible to answer unless you define what a sound is. It might be a vibration in the air or it might be a sensation in your brain, for example. And people sometimes get really emotional about definitions without realising that they're actually arguing about lexicography. So there are a lot of examples in politics that I'm not going to mention because I don't want to go around upsetting people. The closest I can come is to talk about the question of whether Pluto is a planet. And a few years ago, people were getting quite strong arguments about this. And it's not an argument about Pluto. It's just an argument about the definition of the word planet. I mean, people on both sides of the argument about whether Pluto is a planet, both agreed on all properties of Pluto. And what they were arguing about was not some property of the solar system but only about a word planet. And it's the same for arguing about whether one is a prime. You're not arguing about a property of numbers. You're just arguing about the definition of the word prime. I should say there are some, a few mathematicians do actually regard one as a prime. So it's not entirely clear-cut. But almost everybody in mathematics these days has agreed that one is not a prime. So another question is, is there a nice way to produce primes? So Euler's method for showing that there are infinite, so not Euler. Euclid's method for showing there are infinitely many primes will actually produce an infinite number of primes. But it's rather difficult after the first few steps. You start getting very, very big numbers and they're hard to factorize. So we can try and find some other methods. So what happens if we take, say, the product of the first few primes and add one? So we get 2 times 1, 2 times 3 plus 1 is 7, 2 times 3 times 5 plus 1 equals 31, 2 times 3 times 5 times 7 plus 1 is equal to 2, 1, 1. And these are all primes. So this sort of looks as if you multiply together the first few primes and add one, then you always get a prime. Well, if we go on a bit to discover that's not true. So 2 times 3 times 5 times 7 times 11 times 13 plus 1 is 30031, which is 59 times 509. So that doesn't actually work. You know, it's quite plausible that this number is likely to be a prime because you've made it not divisible by a lot of small numbers. So these numbers are certainly more likely than most numbers of about that size to be prime. But as you see it fails. You should also take note from this that the theory of numbers is a very experimental subject. I mean, good number theorists spend an awful lot of time doing calculations in order to find out what's going on. These days calculations are often done by computer, of course. So that way of generating primes doesn't work. And there seems to be no easy way of generating primes. For example, Euler came up with the following polynomial, x squared plus x plus 41. And if you take x to be 0, 1, 2, 3, 4 and so on, this generates an awful lot of prime. So if x is 0, this is 41. If x is 1, it's 43. If x is 2, it's 47. And if x is 3, it's 53 and so on. And it generates primes all the way up to I think it's about 39. But for x equals 40, you can see that it's divisible by 41. So this suggests the following problem. Can we find a polynomial, p of x, that is always prime? I mean always prime for x and integer or maybe a positive integer. Well, the answer is actually yes. We can just put p of x equals 2. It's kind of a stupid answer. So that obviously wasn't what the question meant. What we should have said was non-constant. So is there a non-constant polynomial that's always prime? So you can find polynomials that are prime for quite a lot of the time. But you see it's actually obvious that this one isn't prime for all x because we can just put x equals 41 equal to the constant term and then everything will be divisible by 41. So unless the polynomial is constant, it can't always be prime. So that deals with all polynomials except ones with the constant term equal to 1 or minus 1. But if the constant term is 1 or minus 1, then you can just change the polynomial by say adding something to x to make the constant term not equal to 1 or minus 1 and then the previous proof will apply. So there are no polynomials that generate primes apart from completely trivial ones. And Fermat suggested the following possibility. He suggested the number 2 to the 2 to the n plus 1. So these are the Fermat primes as I mentioned in the introduction. And again for n equals up to about 5, this works. So we get the numbers 3, 5, 17, 2, 57, 6, 5, 5, 3, 7. But after that these numbers have been composite as far as anyone has checked. So for instance 2 to the 2 to the 6 plus 1 is divisible by 641. And this factor was found by Euler. And this is actually quite impressive if you remember that Euler did not have a computer or a calculation and did all his calculations by hand. So the question is how did Euler find this factor? Well we'll be explaining a little bit more later on in the course how Euler came up with this factor by hand calculation. So summary is we just don't know a really easy method of producing very large primes. We know some reasonably good methods but they all involve a fair amount of hard work. There are also several variations of Euclid's proof. So first of all we can find infinitely many primes of the form 2n plus 1. Well that's completely trivial, that just means odd primes and they're all odd apart from 2. What about primes of the form, well instead of 2n plus 1, what about 3n plus 2? Can we find infinitely many primes like that? Well we can by doing a minor variation of Euler's method. What we do is we take, suppose we found lots of primes p1, p2, up to pn. What we do is we multiply them all together and then instead of adding one we multiply this by 3 and subtract 1. And let's take pn plus 1 to be a factor of this. And then just as an Euler's proof we can see that pn plus 1 is not equal to p1 up to pn. Next we can ask is pn plus 1 of the form 3n plus 2? Well not necessarily. But we can't have all factors of the form 3n plus 1. Because the product of any numbers of the form 3n plus 1 is also of the form 3n plus 1. So this is of the form 3, let me use 3m. I don't want this m to be muddled up with that n. So this is of the form 3k minus 2. And you notice the product of any numbers of the form 3m plus 1 is also of the form 3m plus 1. So this must have at least one factor that's not of the form 3m plus 1. And the factor can't be 3 and it can't be one of the primes we first thought of. So the answer is sometimes one of the factors, well at least some of the factors must be of this form. So we get an infinite number of primes of the form 3n plus 2. Well how much further can we push this? Well the same proof works for primes of the form 4m plus 3 or 6m plus 5. But beyond that it doesn't seem to work for any other arithmetic progressions, at least not in any easy way. You can go a bit further by using more complicated arguments. Here I will do the case that there are infinitely many primes of the form 4m plus 1 by using a variation of Euler's method. Now we need to use the following fact that if p divides a number of the form n squared plus 1, then p equals 2 or p is of the form 4m plus 1 for some n. So you can check this for a few values of n. So we have 2 squared plus 1 is equal to 5. 3 squared plus 1 is equal to 2 times 5. 4 squared plus 1 equals 17. 5 squared plus 1 is equal to 2 times 13. And you see all these numbers are all either 2 or of the form 4m plus 1. So we'll be proving this a bit later. But meanwhile let's just use it to show there are infinitely many primes of the form 4m plus 1. And now we use the following variation of Euler's proof. If we found primes p1 up to pn, let me stop using the number n too much. Let p1 up to pm say, then I square this and add 1. And now take pm plus 1 dividing this. Then pm plus 1 is a new prime, not of the form 4k plus 3 because we said primes of the form 4k plus 3 can't divide 1 plus square. So we get infinitely many primes, not of the form 4k plus 3. And the only possibilities are that they are 2 or of the form 4k plus 1. So we find infinitely many primes of the form 4k plus 1 by using a slightly more complicated argument. So you can use a similar argument to show there are infinitely many primes of the form 3k plus 1 or even 5k plus 1 with a little bit more effort. But as far as I know it's still an open problem. Find an easy proof that there are infinitely many primes of the form 5k plus 2. 5k plus 1 you can actually do. This was actually first proved by Dirichlet who proved more generally that you can find infinitely many primes of the form ak plus b whenever a and b are co-prime. So he showed there are infinitely many primes in arithmetic progression. So we've proved a few simple cases Dirichlet's theorem by using variations of Euclid's original proof. But there's no known easy method that works apart from these cases and a few more cases. Okay next lecture we'll be covering Euclid's algorithm which is not really much to do with Euclid's theorem.