 This lecture is part of an online undergraduate course on the theory of numbers. This is just the introductory lecture. So what I'll be doing is giving an informal survey of some of the problems that occur in the theory of numbers. So the theory of numbers is mostly about positive integers and in particular about primes. So you all know the primes 2, 3, 5, 7, 11 and so on. And we can ask some basic questions about primes. For instance, you might ask how many are there? And the answer to this was given by Euclid more than 2,000 years ago. He said that there are infinitely many. Well actually he didn't say that there are infinitely many because Euclid kind of didn't really approve of the concept of infinity. And what he said was that for any finite number of primes you can find another one. But that's the same, really the same as saying there are infinitely many. We can ask a more precise question how many are there less than or equal to x for some real number x? Well it's quite difficult to give an exact answer to this because as you see from the list of primes they look a bit random. But we can ask roughly how many are there less than x? And the answer to this is there are roughly x over log of x. I should say I'm using the mathematician's notation where logarithm means natural logarithms to base E. People quite often use Ln instead if they're not mathematicians but this is the traditional notation. This is called the prime number theorem and this was possibly one of the biggest results proved in the 19th century. It was proved by Ademar and de la Vallée Poussin. And what it says is roughly speaking the chance that some large number n is prime is about 1 over log of n. Well of course that's a sort of meaningless question that a large number doesn't have a probability of being prime. It's either prime or it isn't. So in number theory you sort of quite often use improbability in a sort of informal way. When you say the chance that a large number n is prime is so and so what you mean is that if you look at all the numbers from 1 to x for a large x then the chance of one of those picked at random is about 1 over log of x which is slightly more meaningful. And there are also some special sorts of primes. So two very famous examples are the center primes which are primes of the form 2 to the n minus 1. For example 3 or 7 or 31 are all 1 less than the power of 2. And you can ask how many of these are there. So are there an infinite number of these and this is an unsolved problem. In theory it's full of questions that almost anyone can ask and that seem almost impossibly difficult to answer. So computer calculations of the send prime sort of hint that there may be infinitely many when we found quite a lot of them. Incidentally the largest known prime at any given time is almost always a must send prime. That's because it happens to be particularly easy to check whether or not a must send number is a prime or not. Alternatively you can ask are there about Fermat primes. So here we take 2 to the n minus 1. Fermat primes are of the form 2 to the n plus 1 except it's easy to check that the exponent usually has to be itself a power of 2. So Fermat primes are usually taken to be primes of this form. And here there are some examples 3, 5, 17, 257, 6, 5, 5, 3, 7 and these are the only ones known. People have done computer searches up to quite high values of n and so far none of them have turned up. So it is an open question. Are there any more Fermat primes? Fermat primes also turn up in a rather odd way. So there's the very ancient geometric question of which regular polygons you can construct by rule and compass. And Gauss absolutely stunned everybody in the around 1800 by showing that you can construct a regular polygon with a prime number of sides if and only if the prime was 2 or one of these Fermat primes. So there's a very unexpected connection with geometry there. Primes also turn up in the fundamental theorem of arithmetic, which we will be proving a bit later. I just recall that this says every number, every positive integer can be written as a product of primes in a unique way. Up to order of course. For instance we can write 120 as 2 times 2 times 2 times 3 times 5 and there's no other way of writing 120 as a product of primes except by reordering them. So the next common thing you try and do in the theory of numbers is try and solve diophantine equations. So what are these? Well they're named after this guy called Diophantus and not a lot is known about Diophantus. He seemed to have worked in something like the third century and may have been in Alexandria but we don't really know much else about him. So a diophantine equation is an equation where you want the solutions to be integers. Actually Diophantus himself didn't seem to have looked at solutions that were integers. First of all he insisted that his solutions had to be positive because at that time negative numbers weren't really countered as numbers. Secondly he was quite happy with rational numbers of solutions and not just integers. Anyway, diophantine equation normally means you want the solutions to be integers. So here are some examples. First of all we can have linear equations. So we might want to solve 27x plus 11y equals 1 and we'll be studying Euclid's algorithm for solving this. Linear equations, it's not immediately obvious what x and y are but it's not terribly difficult to find then. Then we can look at quadratic ones. And here there's a very famous one. We can have a squared plus b squared equals c squared so this is the Pythagoras. It showed that if you've got a, b and c like that they form a right angle triangle. For instance the famous example is 3 squared plus 4 squared equals 5 squared. So there's a problem. Can we classify all solutions of this equation? More generally you can look at binary quadratic forms. So a binary quadratic form is something of the form ax squared plus bxy plus cy squared where a, b and c are constants. For instance we could have x squared plus y squared as a binary quadratic form. And we can ask, you know, which integer does it represent? That means when can we solve this equation here? And this can be quite difficult. For example if we look at the equation x squared equals 94y squared plus 1. Well it has an obvious solution where y is 0 but what's the next solution? Well you can find a solution x equals 2143295 and y equals 221064. So we want to discuss how do you find such huge solutions? Well these days there's a kind of stupid way to find these solutions because any computer will find these solutions in a blink of an eye. But what we really want to do is have an efficient algorithm for finding these solutions but that doesn't involve just checking every number until you hit a solution. So we would like to understand this well enough that we can find solutions like this by hand without checking every possible case and not just using a very big computer. So roughly speaking degree two diaphanetine equations are pretty well understood. They're not at all trivial but we can generally answer questions about them, at least if we've got only one. Degree three on the other hand equations tend to be really hard. There's a really notorious example called Fermat's Last Theorem which wasn't a theorem by Fermat and wasn't his last one either but anyway. So it rather famously said can you have any solutions of the equation x to the n plus y to the n equals z to the n greater than or equal to three. By solutions you mean non-trivial solutions so x, y and z aren't allowed to be zero or otherwise it's kind of trivial. And Fermat himself proved this was impossible for n equals three or four and claimed to have done it for other exponents but probably didn't. Anyway this was finally proved by Wiles and this was a great relief to everybody when he did it because Fermat's Last Theorem, every mathematical amateur in the world tried to prove Fermat's Last Theorem and they always sent their solutions to math departments and mathematicians had to think of plight ways of telling them that their solutions were wrong. So another famous example is the diaphanetine equation x cubed plus y cubed equals z cubed plus w cubed and this equation has a sort of little story behind it because when the great mathematician Ramanujan was in hospital he was visited by Hardy who apparently said he came in taxi cab number 1729 and said what a boring number it was and Ramanujan said no it wasn't boring it was the smallest solution of this equation because 1 cubed plus 12 cubed is equal to 10 cubed plus 9 cubed. Actually I sort of suspect Hardy knew perfectly well this was an interesting number I'm just trying to cheer and manage a knot by giving him something to think about but whatever. By the way when I say degree at least three is hard this is actually a theorem. There's a very famous theorem by Julia Robinson, Martin Davis and Putnam and Mattias Savic that says there is no algorithm that will tell you whether any given diaphanetine equation has a solution or not. I mean for a fixed diaphanetine equation you may be able to solve it but there is no algorithm that will work for all diaphanetine equations so the best we can do is find methods for solving special classes of diaphanetine equations we're never going to come to an end of open problems about them. So how do you solve diaphanetine equations? Well one very powerful technique is congruences. So suppose we want to solve the equation x squared equals 1, 2, 9, 8, 7, 3, 2, 4, 8, 6, 5, 9, 7. Okay well you could sit down with a pocket calculator or something and think about it but in fact there's a very quick solution you just look at this last digit and notice that it's a 7 and we notice the last digit of x squared is always 0, 1, 4, 5, 6 or 9 and so we can see instantly that this number can't be a square just by looking at its last digit. This is an example of looking at a congruence so we recall that we say a is congruent to b modulo m this just means the difference a minus b is divisible by m so roughly speaking modulo m means you sort of ignore multiples of this number m for example when we say the last digit of x squared is 0, 1, 4, 5, 6 or 9 well the last digit means you're looking at mod 10 so this just says x squared is congruent to 0, 1, 4, 5, 6 or 9 modulo 10 and working modulo a number is a very powerful technique and in fact the working modulo a given number turns out to form something called a ring that we will review it basically says the usual rules of high school arithmetic mostly sort of work with one or two exceptions when you're just working modulo a number in particular if we've got a polynomial equation suppose we've got some difantine equation which has a may or may not have a solution x, y, z equals 0 you can ask does this have a solution in z well if it has a solution in z this implies that p x, y, z is congruent to nought mod m has a solution for all integers m so you can quite often show that this difantine equation doesn't have a solution by showing that it doesn't have a solution modulo say 73 or something then you can ask does the converse hold so suppose you can solve an equation modulo m for all integers m maybe ought to solve it over the real numbers can you solve it over the integers well if you can you say the hassa principle holds it's called the hassa principle because hassa proved that something like this quite often holds for quadratic equations this is not trivial even for quadratic equations for example suppose you're given a number a suppose you can solve x squared is congruent to a mod m for all m then we can ask is a a square and you see this it's not terribly difficult to answer but it's not quite trivial either it turns out so anyway the hassa principle holds for linear equations and sort of holds for quadratic equations sometimes whether or not it holds for equations of high degree is a rather tricky question in fact it usually doesn't and then you have to sort of try and figure out what the obstruction to it holding is one very famous question about congruence as I should mention is Fermat's theorem which is nothing to do with Fermat's last theorem so Fermat's theorem just says that x to the p is congruent to x mod p is when p is prime and this is an absolutely fundamental theorem of number theory I mean almost I mean a huge amount of number theory would just disappear if you weren't allowed to use this for example it says 2 to the 11 is congruent to 2 modulo 11 which you can check that's 2048 minus 2 which is 2046 which is divisible by 11 so let me just mention one application of this theorem it gives us an usual test for primes so if you've got a large number n it can be quite difficult to tell whether or not it's prime and one way that sometimes works is suppose you've got this number n you look at 2 to the n modulo n and if 2 to the n is not congruent to 2 modulo n this implies n is not prime and as we will see it turns out to be quite easy to check whether or not 2 to the n is 2 modulo n even if n is very big and has hundreds of digits so this sometimes allows you to show that numbers are not prime the converse isn't true that sometimes n is not prime but 2 to the n can still be congruent to 2 modulo n so it's actually quite a tricky question to think what other conditions you need to show that n is prime finding large prime is actually really useful in cryptography because many of the methods of encryption used these days on the internet for even buying and selling things and so on depend on the existence of large primes so I think the number theorist Hardy used to like to sort of boast that the number theory he did was completely and utterly useless and it turns out that it isn't I mean cryptography is now worth billions and billions of dollars because it underlies most internet sales so even the most apparently useless bits of mathematics quite often turn out to be quite useful so next we look at a special case of congruences which are called quadratic residues so one of the most fundamental questions about a number a turns out to be whether a is a square modulo m and for various historic reasons we say a is a quadratic residue mod m if x squared is congruent to a mod m is solvable in other words you would find an x such that a is a square you could just say a is a square modulo m and this would be clearer but for historical reasons they're called quadratic residues sometimes we insist that a should not be divisible by m or should be co-prime to m so this really just means a is a square modulo m for example if m is equal to 5 let's find the quadratic residues well 1 and 4 are obviously quadratic residues because the squares are 1 and 2 and if you add a multiple of 5 to these that will still be a quadratic residue we get 6, 9, 11, 14 and so on and quadratic non-residues are 2, 3, 7, 8, 13, 12 and so on whether or not 0 or 5 or 10 and so on counters quadratic residues depends on which definition of quadratic residue you use it's a little bit unclear so quadratic residues leads to the notion of quadratic reciprocity I really wish they had found a word that was easier to spell so quadratic reciprocity is the following let's look at the following two questions is p a square modulo q so here I'm going to take p and q to be odd primes and ask whether this is solved but I'm also going to ask whether x squared is congruent to q mod p is solvable so we've got two different equations these seem to have nothing to do with each other so the first one says you can solve x squared equals p plus mq and the second one says you can solve x squared equals q plus mp for some p there's no reason, no obvious reason why these two equations should have anything very much to do with each other but it turns out that whether or not you can solve the first equation is very closely connected with whether or not you can solve the second equation if p or q is congruent to 1 modulo 4 then we can either solve both or neither on the other hand if p and q are both congruent to 3 mod 4 we can solve exactly 1 which is a very bizarre result there's this very mysterious hidden relation between these two equations and in fact that is in some sense the essence of what mathematics is about it's about finding unexpected hidden structure here we found this unexpected hidden connection between these two equations so to show that this is powerful and non-trivial and we notice that 101 is a square modulo 5 and this is obvious because this is congruent to 1 modulo 5 now these are both primes that are congruent to 1 mod 4 so this implies that 5 is a square modulo 101 and I think this is by no means obvious what it says is you can solve x squared equals 5 plus 101 times m and you can try and find the smallest value of x and if you use trial and error it will probably take you quite a long time to find it if you're doing it by hand so next I'll give some examples of a few other areas of mathematics first of all we have additive number theory and this is a question of asking which numbers you can get by adding numbers from a certain set quite often you ask about adding or subtracting primes so one of the most famous and notorious of these is Goldbach's conjecture and the last is every even number greater than or equal to 4 the sum of two primes and this just seems to be out of reach of present techniques this is another example of the question you know someone who knows almost nothing about number theory or mathematics could ask this question it just baffles everybody we've got some partial results on easier questions Hardy, Littlewood and Vinogradov showed that every odd number that's sufficiently large is the sum of three primes and this is a bit weaker because if every even number is a sum of two then you can very easily get every odd number bigger than seven or something as a sum of three primes so Hardy and Littlewood gave a conditional proof on this where they assumed a rather difficult unproved hypothesis and Vinogradov then managed to remove this assumption there's another variation on Goldbach's conjecture Chen in about the 1970s showed that you can write almost every even number as the sum of a prime plus a product of two primes so he's sort of using three primes rather than two primes to get it and apparently this made Chen really famous in China I mean his result got into newspaper headlines and so on and for some time although most of the amateurs sending in proofs were trying to prove Fermat's last theorem if the proof came from China it was always an attempted proof of Goldbach's conjecture because Chen had become so famous in China another variation of this is are there an infinite number of prime pairs or twin primes so what are these? well these are primes that differ by two for instance we can have three and five or eleven and thirteen or twenty nine and thirty one and it sure seems that there are a lot of them but again this seems to be completely out of reach of current techniques there was some amazing progress on this recently by Zhang or Pope I pronounce his name right who showed that there are infinitely many pairs of primes that differ by most seventy million so all we've got to do is to get seventy million down to two and we've proved it and you may think seventy million isn't very impressive but it's far better than anything anybody else had managed to prove this number seventy million has since been reduced I think the current record is a few hundred or so but the really big step was getting it from very little known to seventy million once you've got it down to some finite number you can just sort of nibble away at it and get it down earlier so this is an example of subtracting primes rather than adding them but it's still an additive operation and it's also a question about gaps between primes and questions about gaps between primes seem to be incredibly difficult for instance there's a notorious old question is there a prime between n squared and n plus one squared so that's saying are gaps between primes at most about the square root of n in some sense and they seem in practice to be much smaller than that that the biggest gap between primes seems to be at most log of n squared or something like that but nobody's managed to get anywhere close to proving even this much weaker bound incidentally there's a view or at least there used to be a view that adding or subtracting primes was a kind of silly thing to do for example the very great applied mathematician Vladimir Arnold once wrote a report on the Zurich mathematical congress and in that he poured absolute scorn on these sort of questions he quoted the physicist Landau who's nothing to do with the number theorist Landau who said you know why these idiotic mathematicians adding primes primes are meant to be multiplied not added so Arnold in particular had complete contempt for this sort of problem however I should say that Arnold's had complete contempt for the whole of number theorist as far as I can figure out or maybe he was just enjoyed being provocative I don't know yeah I think I should say I think part of the reason why people dismiss these questions is they were simply too difficult I mean there's a certain amount of sour grapes going on that if a question is just too difficult there's a temptation to say it's just a silly question we shouldn't be looking at it but the fact that we've had quite substantial progress by Zhang and Chen in the last few decades suggests that maybe these questions should be taken more seriously now we come to some questions that really almost certainly are nonsense let's talk a bit about recreational number theory and give some examples of these well these are questions that just don't seem to have any interesting structure behind them that anyone has ever managed to find out so let me give some examples you can talk about perfect numbers so these are numbers that are the sum of their proper divisors so 6 is 1 plus 2 plus 3 and 1 and 2 and 3 are the divisors of 6 other than 6 itself and 28 is 1 plus 2 plus 4 plus 7 plus 14 so 6 and 28 are both perfect numbers and a couple of thousand years ago perfect numbers were almost the central number theory and quite a few people seem to take them very seriously Euclid, for example, has a proposition about them showing that if 2 to the p minus 1 is prime which you'll recognise as being a Mersenne prime then 2 to the p minus 1 times 2 to the p minus 1 is perfect and notice that here where the 1 is in the exponent and there it's down there so this is 2 to the 2 minus 1 times 2 to the 2 minus 1 and this is 2 to the 3 minus 1 times 2 to the 3 minus 1, for example so there you get the first 2 and you can see examples of things called deficient numbers such as 4 where the sum of the divisors is less than the number and abundant numbers where the sum of the divisors is greater than the number so here 12 is abundant so that's greater than 12 and this is less than 4 and some people used to take these quite seriously I mean, there was a guy called Nicomachus who wrote all about these and said, you know, deficient numbers are horrible because they're like an animal with limbs missing and abundant numbers are like monstrosities with extra limbs but perfect numbers are just right and frankly nobody has any idea what he was talking about perfect numbers also turn up in religious works of all places so St Augustine wrote a famous book called The City of God which is apparently a foundational work in Catholic theology and in the middle of this several hundred page book he starts defining perfect numbers and he explains, you know, he gives a correct definition of perfect number and explains that the reason God created the world in 6 days is that 6 is a perfect number and I have no idea why a reasonably intelligent person would come up with such a bizarre idea and I don't think anybody else understands it either and we can also various other variations for instance we can talk about amicable numbers these are numbers such that like 220 and 284 where 220 is the sum of the proper divisors of 284 and 284 is the sum of the proper divisors of 220 so what seems to be going on here is people are considering this dynamical system where you take a number N and you map it to the sum of the proper divisors and then you can say perfect numbers are the fixed points of this dynamical system and amicable numbers are orbits of size 2 and people also look at orbits of higher size so you could say that, you know, the study of perfect numbers is really a special case of the study of discrete dynamical systems which is actually a reasonably serious topic here's another famous example suppose you take a number N and then you map it to N over 2 if N is even and 3N plus 1 if N is odd so this is sometimes called the 3N plus 1 problem and you keep repeating this and the problem is if you start with a number N do you always eventually get to 1 so this is another dynamical system you're taking number N and iterating this operation a lot of times and it's very hard to tell what happens in fact in general you can't really tell what happens with a discrete dynamical system because any Turing machine can be encoded as a discrete dynamical system and there's in general no way to tell what a Turing machine does so all these sorts of questions are in general incredibly difficult to solve so now let's give a brief survey of analytic number theory here we have one of the most famous or notorious functions in mathematics the Riemann-Zeta function which is 1 over 1 to the s plus 1 over 2 to the s plus 1 over 3 to the s and so on for instance Euler became very famous by working out Zeta of s when Zeta is equal to 2 he showed that Zeta of 2 is pi squared over 6 and he went on and showed that Zeta of 4 is equal to pi to the 4 over 90 so what Zeta of 3 nobody knows there's no similar result for Zeta of 3 that anyone has ever found out it's known to be irrational this was a stunning result proved by Appare a few decades ago but no one's ever found a really nice explicit formula for it so Euler also found this really nice infinite product for Zeta of s it's 1 over 1 minus 2 to the s times 1 over 1 minus 3 to the minus s times 1 over 1 minus 5 to the minus s times 1 over 1 minus 7 to the minus s and so on and you notice all the primes are turning up here and this strongly suggests that this function Zeta of s is something to do with primes and in fact it seems to sort of control primes for instance Riemann found this amazing formula I'll tell you what it's a formula for in a moment so his formula is the logarithmic integral of x minus the sum over rho of the logarithmic integral of x to the rho so what's going on here well Li of x is more or less the logarithmic integral well it's not quite equal to this but there are some minor technical complications that I won't go into here these numbers rho are over the zeros of the Zeta function of s and these are actually complex zeros and this is a little bit odd because Zeta of s only converges when the real part of s is at least 1 and these zeros are all of real part less than 1 so you need to do something rather clever to make sense of Zeta of s and this is done by something called analytic continuation which occurs in complex analysis courses so anyway Riemann found this amazing formula but I haven't told you what it's a formula for well it's almost a formula for the number of primes less than x except it's not quite because we have to count p to the n as 1 over n of a prime so it's really a formula for a weighted sum of prime powers where prime powers like 4 and 8 are sort of almost primes and Riemann's formula is rather extraordinary for instance if you ignore all these terms here and only look at the first term and work out the number of primes less than say 10 to the 8 you find the number of primes is 5761455 whereas Riemann's formula gives 5761522 as its first term and these various correction terms give you the difference so you can see the difference is only about 100 out of you know sort of 5 million primes so Riemann found this astonishingly accurate formula for primes in fact it's exact if you include the correction terms but the correction terms are kind of tricky because they depend on the zeros of the zeta function and it's a really hard problem trying to figure out where these are Riemann came up with this conjecture called the Riemann hypothesis that they all have real part at most a half and they certainly seem to but this is you know this Riemann hypothesis is possibly the most notorious current open problem in mathematics next we move on to a bit more analytic number theory we go to Dirichlet's theorem Dirichlet proved there are infinitely many primes with last digit 3 and this seems kind of obvious the last digit of a primer than 2 and 5 must be 1, 3, 7 and 9 and it seems reasonably plausible that there should be infinitely many with each of these last digits but it's surprisingly difficult to prove more generally he proved there are infinitely many primes of the form a n plus b where a and b are co-prime and n is an integer greater than or equal to zero so this is an arithmetic progression and he showed that for every arithmetic progression there are infinitely many primes in it unless they obviously aren't because if a and b have a common factor then you obviously can't do that and Dirichlet proved this by using generalizations of the Riemann zeta function which are now called Dirichlet L series in his honor so a typical one is 1 over 1 to the s minus 1 over 3 to the s plus 1 over 5 to the s minus 1 over 7 to the s and so on and the amazing thing about Dirichlet's theorem was he was proving theorems about primes which are just integers by making use of analysis his proof made a central use of the fact this is a function of a real variable s so that's a good example of analytic number theory where you use analysis to prove results about number theory by the way Dirichlet's theorem sounds a bit like a theorem due to green and tau so the green tau theorem says we can find long arithmetic progressions of primes so for example we can find an arithmetic progression of length 3 which is 3, 5, 7 or we can find the arithmetic progression of 11, 17, 23, 29 of length 5 and you may ask can you find an infinite long arithmetic progression of primes and it's an easy exercise to show that you can't then you can ask can you find arithmetic progressions that are as long as you like and green and tau manage to show that you can and the proof is kind of amazing since people have thought this sort of question was just out of reach and other these questions about adding or subtracting primes which are always very difficult in fact I think tau has said that this is not really a theorem about primes at all it's really a theorem about arithmetic progressions what it says is you can find arithmetic progressions in there's a sort of principle you can find long arithmetic progressions in any set of numbers that's reasonably dense and what you have to do is to show that in some sense primes are dense enough for this to work incident you the green tau theorem sounds as if it doesn't have any applications but in fact there wasn't odd application of it I said the Robinson and Davis and Putnam and Matjesowicz proved that you can't find an algorithm for solving Diophantine equations and earlier Davis and Putnam had proved that for exponential Diophantine equations but their proof wasn't quite complete because it used this theorem which hadn't actually been proved at the time so even rather odd theorem like this does have applications next I'll give a quick summary of some results in algebraic number theory so we might ask the following two questions can you write a prime p as a sum of two squares can you write a square m as a sum of two primes and at first sight these questions kind of seem equally silly there's no particular reason for adding primes and doesn't seem to be any particular reason for adding squares but the first question turns out to be a very beautiful answer we can write p as a sum of two squares if and only if p is equal to two or p is common to one modulo four and one way of solving this is to use the so called Gaussian integers so these are numbers of the form m plus n i where i is the complex number with square minus one and m and n are just ordinary integers and the Gaussian integers behave quite like the ordinary integers in many ways for instance there's a theorem about unique factorization into primes and the factorization of primes is a little bit different from the Gaussian integers for instance you might think that five is prime but in the Gaussian integers it's two plus i times two minus i and similarly thirteen is three plus two i times three minus two i and if you multiply these out you find this is two squared plus one squared and this is three squared plus two squared so the fact that five and thirteen factorize in the Gaussian integers it turns out to be related to the fact that they can be written as a sum of two squares and similarly three can't be written as a product to do smaller numbers so three is not equal to m squared plus n squared for any m and n it turns out you can prove this theorem that a prime is one mod four if and only if it's the sum of two squares by making use of the Gaussian integers if you want to try proving this it's quite easy to show that if p is three mod four then it's not a sum of two squares but it's much harder to show that if p is one mod four then it is a sum of two squares anyway this is one of the things we'll be doing later then I'll give some examples from combinatorial number theory so one example is the partition function so suppose you've got a number five and we try and write it as a sum of positive integers well we can write it as five or four plus one or three plus two three plus one plus one two plus two plus one two plus one plus one plus one plus how many ones have I got one two three four five and there are one two three four five six seven ways of doing it so we say the number of partitions of five is equal to seven and we can make a table of these partitions so if n is equal to zero one two three four five six or seven the number of partitions goes one one two three five seven eleven and now you notice there's this very nice pattern here the number of partitions of an integer turns out to be just the sequence of primes you see this two three five seven well no actually it isn't because the next number is fifteen rather unfortunately so this is just some sort of freaky coincidence but it does actually make it easy to remember the values of the first few values of the partition function so what can we do with partitions well Euler studied them and he found this rather nice formula for it suppose you form the partitions into a power series so this is one plus q plus two q squared plus three q cubed plus five q to the four and so on then he found this can be written as one over one minus q one minus q squared one minus q cubed and so on this is reasonably easy to prove if you want an exercise you notice from this that Euler was really rather good at finding interesting infinite products of things because he found this infinite product for partitions and he found the infinite product for the zeta function so a typical example of a number theoretic problem about partitions is congruences for partitions for example it turns out that p of five n plus four is always divisible by five and partition functions are large numbers of rather weird and mysterious congruences and I'd say that the congruences of the partition function is still not fully understood for instance we can't really tell you any simple way of telling whether p of n is even or not so I'll just finish by just suggesting a few books on number theory I'm just going to suggest some rather old classic books the first one is the book by Hardy and Wright an introduction of theory of numbers and this is a rather nice book for an introduction because it sort of gives samples of lots and lots of different topics in number theory so it covers a little bit about almost everything and gives a lot of interesting historical background and so on if you want to textbook with exercises a classic one is the one by Niven and Zuckerman actually this is a rather old edition there's a newer edition with some editions by Mont-Gomri which you should probably get if you want to buy it finally I want to mention what is possibly the most famous book on number theory of all time which is Gauss' book on Disquisity and his Arithmetic so he originally wrote it in Latin which means arithmetical research but there are now several English translations there's the original Latin page you can see he actually wrote his name in Latin if you want to get it and have a look at it I would recommend getting the edition published by Springer rather than the edition published by Yale because unfortunately the edition published by Yale has mathematical errors in it which were corrected in the Springer edition ok that's the end of the introduction the next lecture I will be discussing Euclid's proof that there are an infinite number of primes