 This lecture is part of Berkeley Math 115, an online course on number theory for undergraduates. This is a continuation of the previous lecture on primes, and will be mostly about arithmetical functions. So an arithmetical function is just a function from the integers, or the positive integers 1, 2, 3, 2, well, anything, it could be the complex numbers, or the reals, or even just the integers again. So it's just a function defined on positive integers. And there are some obvious examples. We could just have fn is some power of n, like n to the k. This is the property that f of mn is equal to f of m times f of n. And functions with this property are particularly interesting. They're called strictly multiplicative. We'll see what non-strictly multiplicative functions look like a little bit later. So powers of n are the most obvious strictly multiplicative ones, but there are also some other examples. For instance, we can have a function which looks like this. So fn just looks like this. So here's n. And fn is just going to go 1, 0, minus 1, 0, 1, 0, minus 1, 0, 1, and so on. So it just repeats with period 4. So it's equal to 1 if n is equal to 4m plus 1, minus 1 if n equals 4n plus 3, and 0 if n is even. And you can again notice that this is multiplicative. It has this property here. Later on, we will have some very important examples of strictly multiplicative functions called the Legendre symbol given by fn is equal to np, where this is not a binomial coefficient. It will be something we define later that tells you whether or not n is a square or not modulo p. This example and this example are both examples of things called Dirichlet characters, which will again be turning up later on in the course. So the Dirichlet character is strictly multiplicative and it also takes values that are complex numbers of absolute value 1. Another example of a strictly multiplicative function is the Liouville function, which is sometimes known by lambda of n, and lambda to the n is easier to define. It's just equal to minus 1 to the power of omega of n. So what's omega of n? Omega of n is equal to the number of prime factors counted with multiplicities. For example, if you take the number 60, this is equal to 2 squared times 3 times 5, so omega of 60 is equal to 2 plus 1 plus 1, so there should be an exponent 1 there and so on. So it's got 4 prime factors except you have to count 2 twice because it's got an exponent of 2. If you don't want to count primes with multiplicity, there's another function called little omega, where little omega of 60 would just be 3, because here you don't count primes with repetition. Anyway, you notice that big omega of n is equal to omega of m plus omega of n, which easily implies that lambda of n is equal to lambda of m times lambda of n. Little omega doesn't have this property, so it's rather harder to deal with than the big omega function. Well, these are all strictly multiplicative functions, and it turns out that this condition is really too strong. What we really want are multiplicative functions which have the following property. They have the property that f of m n is equal to f of m times f of n if m and n are co-prime. That means they've got no common factors. This seems to be a slightly funny-looking condition, but it turns out there are lots of natural functions with this property, so I'll now give some examples of them. Here's the first example. We could take the divisor function denoted by d of n or sigma zero of n, which is just the number of divisors of n. Let's just look at a few examples. If we take n equals 1, 2, 3, 4, 5, 6, we look at the divisors. Here we've got 1, 1, 2, 1, 3, 1, 2, 4, 1, 5, 1, 2, 3, 6. So d of n is just given by 1, 2, 2, 3, 2, 4. More generally, if n is prime, the only factors are 1 and p, so d of n is just 2. So it can be quite small. On the other hand, if n has a lot of factors, for instance, if it's the factorial of something or if it's something like 60, well, how many divisors does 60 have? Well, this is a little bit complicated because you can see there's 1, 2, 3, 4, 5, 6, 7, 0, 8, 0, 9, 0, 10. This is getting a little bit tedious to count them. Is there a better way? Well, yes there is, because what we do is we use the fundamental theorem of arithmetic and write 60 as a product of prime powers. And now you can see a divisor of n must be able to perform 2 to the a times 3 to the b times 5 to the c, where a is less than or equal to 2, b is less than or equal to 1, and c is less than or equal to 1. There are three choices for a, because you remember we allow a to be 0 as well, and there are two choices of b and two choices for c. So d of 60 is going to be 3 times 2 times 2, which is 12. And obviously we can do the same for any integer. If we know the prime factorization of an integer, so it could be p1 to the n1, p2 to the n2 and so on, then d of this number is equal to n1 plus 1 times n2 plus 1 and so on. So if we know the prime factorization, then it's easier to work out the number of divisors. You also see that this immediately shows that the number of divisors of n is multiplicative. So this is equal to d of m times d of n, if m and n are co-prime. Because if they're co-prime, then the formula for d of m times the formula for d of n is just the same as dmn. If m and n are not co-prime, then this fails. For example, if we look at d of 4, this is equal to 3. But d of 2 is equal to 2 and d of 4 is not equal to d of 2 times d of 2. The trouble is that the factor 2 kind of overlaps when we write the factor 2 there kind of interferes with the 2 there. So the divisor function is multiplicative, but it's not strictly multiplicative. So let's have some more examples of multiplicative functions. Another one is the sigma of n, which is the sum of the divisors. So let's try and work out what is sigma of 60. Sorry, my sigmas look a bit like 6s. I'm not quite sure what to do about that. So 60 we saw is equal to 2 squared times 3 times 5. So the divisors are of the form 2 to the a times 3 to the b times 5 to the c. And we want to sum over all a's from 0 to 2 and all b's from 0 to 1 and all c's from 0 to 1. So we want to sort of sum these numbers. So we're summing all numbers. So the numbers of the form can be 1 plus 1 or 2 or 2 squared times 1 or 3 times 1 or 5. And if we sum over all these what we're going to get is obviously 1 plus 2 plus 2 squared times 1 plus 3 times 1 plus 5. Because if we expand this out we see we get one of these possible factors each time. So this is the sum of the divisors of 60. We just take 7 times 4 times 6, which is much easier than just finding all the divisors and adding them up. And again, exactly the same thing works for any integer if n is equal to p1 to the n1 times p2 to the n2 and so on. Then by the same argument, sigma of n, we get by taking 1 plus p1 plus all the way up to p1 to the n1, then we do the same for p2 and the same for p3 and so on. And we just multiply these up. And you notice this is a geometric series and we know how to add up geometric series. This is just p1 to the n1 plus 1 minus 1 divided by p1 minus 1 and this is the same thing. It's p2 to the n2 plus 1 minus 1 over p2 minus 1 and so on. So this gives us a nice formula for sigma of n provided you know the prime factorization. In fact, working out sigma of n is quite similar in difficulty to working out the prime factorization. For example, if n is a product of 2 primes, then sigma of n is equal to p plus 1 times q plus 1, which is equal to n plus p plus q plus 1. So if you happen to know n is a product of 2 primes and you know the sum of the divisors of n, then you can work out p plus q and you also know p times q. So p and q both satisfy a quadratic equation whose coefficients you know and you can easily use that to solve for p and q. So finding sums of divisors of a number is about as difficult as finding the prime factorization. So another example of a multiplicative function that we're going to see later is Euler's phi function. So phi of n is the number of numbers less than n that are co-prime to n. So let's just work out a few values. If n is 1, 2, 3, 4, 5 and 6, then the numbers co-prime to n between 1 and n. Here we get 1, here we just get 1, here we get 1 and 2, here we get 1 and 3, here we get 1, 2, 3, 4, and here we get 1 and 5. So phi of n becomes 1, 1, 2, 2, 4, 2 and if n is a prime then numbers 1 up to p minus 1 so phi of n is p minus 1 and you can see that this is the biggest it can possibly be. Phi of n is obviously at most n. In fact it's equal to n only if n is equal to 1. And we will see later that phi of m, n is equal to phi of m times phi of n if m and n equals 1. I'm not going to prove this now but when we do the Chinese remainder theorem a bit later we will see this. For instance you can see that phi of 6 is equal to phi of 2 times phi of 3. So it at least works in that case. You also notice that this is false if m and n are not co-prime in general. For instance the value for 4 is not the square of the value for 2. So all of these multiplicative functions it's fairly easy to see their multiplicative. So here's an example where it's rather harder to see that the function is multiplicative. Here what I'm going to do is I'm going to take the following funny looking function. I'm going to take q times 1 minus q to the 24 times 1 minus q squared to the 24 times 1 minus q cubed to the 24 and carry on like this and I'm going to multiply this all out. Well I'm not going to multiply it all out because I'm lazy. I'm just going to look up what the answer is and the answer is it's equal to q minus 24 q squared plus 252 q cubed plus 1472 q to the 4 plus 4830 q to the 5 minus 6048 q to the 6. Actually I think I got a minus sign wrong there but never mind. And you notice that if we write this as sum of tau n q to the n so this is tau 2 and this is tau 6. You might notice that tau of 6 is equal to tau 2 times tau of 3. And Riemannogen noticed that tau of mn seems to be equal to tau of m times tau of n whenever m and n are co-prime. So this was actually proved by Mordell shortly afterwards so it's an example of a multiplicative function where it's not at all obvious that it's multiplicative. And you might think what happens if you change 24 to some other number and if you change 24 to some other number it's nearly always not multiplicative. I mean I think there's one or two cases when you can sort of get it to be multiplicative but this is basically a funny property that doesn't work for anything bigger than 24. Another example of a useful multiplicative function is the Moebius function. So this function is denoted by mu of n. That's actually a Greek letter mu. You can see it actually does look a bit like an m. That's where our m comes from. So mu of n is defined as follows. It's 0 if n is divisible by square greater than 1. And it's equal to minus 1 to the omega n if n is divisible by omega of n primes. And when you first come across this definition it looks kind of stupid. I mean why on earth would you define a function in this rather bizarre looking way? Well before we explain why first of all you notice that mu of mn is equal to mu of m times mu of n whenever m and n are co-primes. So it is at least a multiplicative function. It's a bit like the Louisville function which was strictly multiplicative except you've made it 0 whenever n is divisible by a square. Well now I have to justify why you should introduce such a funny looking function. I'll just give one justification for it. So suppose we take the Riemann Zeta function. Zeta of n equals 1 over 1 to the n plus 1 over 2 to the n plus 1 over 3 to the n and so on. So it's the most notorious function in number theory. Now if you work out 1 over Zeta of s. I'm going to change n to s here because I'm thinking of s as being a complex variable. This turns out to be 1 over 1 to the s plus mu of 2 over 2 to the s plus mu of 3 over 3 to the s and so on. So Moebius's function turns up in the coefficients of the inverse of the Riemann Zeta function. Since the Riemann Zeta function is perhaps the most important and mysterious function in number theory this justifies why you should take the Moebius function seriously. Now I want to give an application of multiplicative functions to perfect numbers. So you remember a perfect number is a number that's the sum of its proper divisors. So 6 for example is the simplest perfect number. As I mentioned in the introduction perfect numbers are not really a terribly serious part of number theory but this will be a sort of good exercise in working with some of these multiplicative functions. And the problem is to find perfect numbers. And 6 is perfect and 28 is perfect. So this is 1 plus 2 plus 4 plus 7 plus 14. So the sum of all proper divisors is half of the sum of the divisors. So what we're doing is trying to solve 2n is equal to sigma of n. So we want the sum of all divisors to be twice the number. And we know what sigma n is in terms of the prime factorization of n. So if n is equal to p1 to the n1 times p2 to the n2 then sigma of n you remember is 1 plus p1 plus p1 to the n1 times 1 plus p2 and so on and so on. And now Euclid in his book on the elements everybody says it's all about geometry but that's actually about a lot of things other than geometry. He gave a way of finding perfect numbers. He said if you take a number 2 to the p minus 1 times 2 to the p minus 1 such that this is prime and p is also remember if 2 to the p minus 1 is prime then p also has to be prime so p is going to be some prime. Anyway this number here is now perfect and this is actually a rather easy calculation. All we do is we expand out this. So since this is prime we know the prime factorization of this number and we just have 1 plus 2 plus 4 plus all the way up to plus 2 to the p minus 1. So that's the that's this bit for the 2 to the p and then we have 2 to the p minus 1 plus 1 here. So that's that bit there and this is equal to 2 to the p minus 1 and this bit is equal to 2 to the p and if you compare that with this see if n is equal to that number here this is just equal to 2n. So this number is perfect and this gives you the first few perfect numbers for example for p equals 2 we get 2 times 2 squared minus 1 and if p equals 3 here we get 2 squared times 2q minus 1 which is 4 times 7 which is 28 and you can easily find the next one for instance if we take p equals 5 we get 2 to the 4 times 31 which is the next perfect number. Well there's actually a nice converse to this found by Euler. Any even perfect number is of this form and let's just show you how to prove this using using the formula for the sums of the divisors. So suppose our number is 2 to the a times p to the b times q to the c and so on where p and q and so on are various odd primes. So we're going to take our number n to be this and we're assuming it's perfect and we can look at all the factors of it and the factor is going to be we take 1 or 2 or 4 up to 2 to the a times 1 or p or p squared up to p to the b and some factor of this and so on so these are the divisors of n and what I'm going to do is I'm just going to take some of the divisors so I'm going to take the divisors where the part here is either p to the b or p to the b minus 1 and for this one I'm only going to take q to the c and let's work out what we get here. The sum of these special divisors is 1 plus 2 plus 2 to the a times p to the b plus p to the b minus 1 times q to the c and so on and I'm now going to add these all up so this is just 2 to the a plus 1 minus 1 and this is just p plus 1 times p to the b minus 1 and you can see that this number is equal to 2 to the n times 1 minus 1 over 2 to the a minus 1 times 1 plus 1 over p so now we notice that this bit here must be at most 1 because the sum of all divisors has to be 2n and the sum of some of the divisors is this and the sum of all of them is going to be at least that. On the other hand we notice that this number here is odd and since this product here is equal to 2n this must be divisible by some prime factor of n so if p is the smallest prime factor of n then p is less than equal to 1 plus 2 plus all the way up to 2 to the a now from the fact that p is less than or equal to 2 to the a plus 1 minus 1 we see that this factor here must be greater or equal to 1 if p is equal to 2 to the a plus 1 minus 1 you can easily check this expression is 1 and if p is less than that that makes this even bigger so on the one hand this expression must be at most 1 and on the other hand it must be at least 1 we see that must be exactly equal to 1 well if it's exactly equal to 1 then we can't have any other divisors so in particular this implies b must be equal to 1 it implies we can't have any other primes q dividing it so q, r and so on do not exist and it also implies that p is equal to 2 to the a plus 1 minus 1 so in other words our number is equal to 2 to the a times 2 to the a plus 1 minus 1 in other words it's just one of these mo-sen primes that we discussed earlier so this gives us all the even perfect numbers and it leaves two problems are there an infinite number of even perfect numbers? well since these correspond exactly to primes of the form 2 to the p minus 1 we can ask are there infinitely many primes of the form 2 to the p minus 1 and we don't know it's just probably yes and people have found in about 40 or 50 of them by computer the largest that have been found absolutely enormous the largest known at least according to Wikipedia this morning was 8, 2, 5, 8, 9, 9, 3, 3 minus 1 which has about 25 million digits if you try and write it out in other words you need an entire bookshelf of books just to write down this prime number as you see you can't possibly check these things of primes by checking all prime factors up to their square root I mean that would be just absurd fortunately there are much faster ways of checking whether mo-sen numbers are actually primes in fact there used to be something called the sort of mo-sen internet prime search where people would use spare computer time on their computers to help search for new mo-sen primes I think people have stopped doing this to a large extent because if you've got spare cycle time on your computer you don't use it for looking for mo-sen primes anymore you use it for mining bitcoin instead which is more profitable so whatever this is another example of one of these very simple questions that anyone can ask are there infinitely many primes of the form 2 to the P minus 1 and it seems to be hopelessly out of reach of any techniques we have at the moment there's just none of our techniques come even close to this so we can't tell whether they're an infinite number of perfect numbers there's also another question that you can ask are there any odd perfect numbers and nobody knows people have tried to answer this and you can put some very restrictive conditions on your perfect number for example suppose your perfect number is P1 to the N1 times P2 to the N2 and so on then sigma of n must be equal to 2n which must be divisible by exactly 1 power of 2 because n is odd and if you expand this out you see this is 1 plus P1 plus all the way up to plus P1 to the N1 the same for P2 and you notice that if N1 is odd this sum is even and if N1 is even this is odd so let's say this is odd if and only if N1 is even now if this product is 2 times an odd number exactly one of these must be even and that means that almost almost all these exponents here must be odd so this says exactly one of the Ni is odd so in other words the number N can actually be written as a square times a prime because one of these numbers is odd and it's going to be that prime times something with all exponents even so it's a prime times a square and you can push this sort of argument much further and find much more restrictive conditions on odd perfect numbers but it's very frustrating if you do this because you never quite get a contradiction and nobody's been able to prove that odd perfect numbers don't exist and people have done computer searches and haven't been able to find any so nobody knows and this is another of these really annoying problems that are easy to state and in some sense are kind of almost pointless but we just have no idea how to solve them in fact this is a good candidate for one of the oldest problems we don't know how to solve people were discussing this problem about 2,000 years ago and we still don't know the answer I'm not quite sure if it's the oldest unsolved problem I'm not an expert on Greek mathematics but I don't offhand know of any older problems we don't know the answer to so I've just finished by listing Landau's collection of really hard problems so these are Landau's problems about primes that he stated about the beginning of last century and just show us how little we know about primes and some more questions that are quite easy to state but we have no idea how to answer so first of all we have the Goldbach conjecture is any even number greater than 4 the sum of 2 primes so next we can ask the Twin prime conjecture so can we find infinitely many primes p1 minus p2 with difference 2 thirdly we can ask suppose we take a number n squared can we find a prime between n squared and n plus 1 squared so that's saying is the gap between prime between numbers at most the square root of the number in fact we think the gaps are a lot less than that but even this case seems to be out of reach of what we can do and finally can we find infinitely many primes of the form n squared plus 1 and again the answer to this seems to be the answer to all these four questions is almost certainly yes we can give probabilistic arguments suggesting they're rather likely to be true but they're all just out of reach of any techniques we've got these days ok next lecture will be on binomial coefficients