 This lecture is part of an online course on the theory of numbers and will be about multiplicative functions. So a multiplicative function is a special case of an arithmetic function. An arithmetic function is just a function from positive integers to something. Something is usually might be integers or it might be reals or something else. So some examples of arithmetic functions we might just take the polynomials for example fn equals 1 or fn equals n or fn equals n squared. These aren't really all that interesting and don't have much to do with number theory. So a typical example of a number theoretic arithmetic function is the function sigma 0 of n which is just the number of divisors of the number n. Explain what the subscript 0 is doing a little bit later. So let's just start by computing some values of it. So let's take n to be 0. Let's start with 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and then sigma 0 of n is just 1, 2, 2, 3, 2, 4, 2, 4, 3, 4 and so on. So you see it's 2 whenever n is a prime and otherwise it sort of seems to go up and down a bit randomly. It doesn't look like a very smooth function if you draw a graph of it. So let's try and work out what it is. And to do this we write n as a product of primes using the fundamental theorem of arithmetic. So it might be p1 to the n1, p2 to the n2, p3 to the n3 and so on. And then we want to know what are the what are the factors of this? Well, they're going to be p1 to the a1 times p2 to the a2 and so on with nought less than or equal to a1 is less than n1, nought less than or equal to a2 is less than or equal to n2 and so on. So we can now easily count how many possible divisors there are. There are n1 plus 1 choices for a1 and n2 plus 1 choices for a2 and so on. So the number of divisors, sigma 0 of n, is going to be n1 plus 1 times n2 plus 1 times and so on. Now I was going to talk about multiplicative functions. So what is a multiplicative function? Well, you might guess that it's a function such that mn is equal to f of m times f of n for all mn greater than 0. And it turns out this condition is really a bit too strong. I mean, there's nothing really wrong with it. It's just that most functions we're interested in don't satisfy well, they don't satisfy this condition. Functions that satisfy this condition are called strictly multiplicative. So a multiplicative function is one that satisfies f mn equals f mfn, which sounds like exactly like the condition I wrote down before, except you say whenever m and n are co-prime. And the first example of a multiplicative function is sigma 0 of n, because you can see that sigma 0 of mn is equal to sigma 0 of m times sigma 0 of n, provided m and n are co-prime. You can see this because sigma 0 is the product of 1 plus the exponents appearing the prime decomposition of n. You notice this definitely doesn't hold when m and n are not co-prime. For instance, sigma 0 of 4 is just equal to 3, whereas sigma of 0 of 2 times sigma 0 of 2 is 2 times 2, which is 4. So if m and n aren't co-prime, this definitely breaks down. So what sort of questions can you ask about arithmetic functions? Well, you can ask things like what are their minimum values or their maximum values or their average values? Well, the minimum value of sigma 0 is not terribly interesting because sigma 0 of n is 2 whenever n is prime, and it's never less than that if n is greater than 1, so the minimum value for large n is just 2. The average value is slightly more interesting. So let's ask what's the average value of sigma 0 of n? Well, you can't really take an average over all integers, but you take an average value for integers up to some constant. So we might try and work out sigma 0 of 1 plus sigma 0 of 2 plus sigma 0 of n and divide it by n. So we're looking at the average value for all numbers from 1 to n. And we can estimate this sum because 1 is a divisor of n numbers from 1 to n, and 2 is a divisor of about n over 2 numbers from 1 to n. I mean, if n is even, it's exactly n over 2. If n is odd, it's slightly less than n over 2. And 3 is a divisor of about n over 3 numbers from 1 to n because it's every third number. And so you go all the way up to n is a divisor of about n over n numbers from 1 to n, in fact, exactly 1 number from 1 to n. There's no point going above that. So now if you add up all the divisors, so sum of all divisors of all numbers from 1 to n, it's just the sum of these things here. So it's about n plus n over 2 plus n over 3 up to plus n over n, which is n times 1 plus 2 plus, sorry, 1 plus a half plus all the way up to plus 1 over n. So the average value of sigma nought from 1 to n is about 1 plus a half plus a third sum plus 1 over n. And you remember how to estimate this sum from calculus. So sums are roughly equal to integrals. So this is approximately the integral from 1 to n of 1 over x dx, which is just log of n. So this suggests that if n is large, then sigma nought of n is on average about log of n. In other words, we expect a large number to have about log of n factors, although these will obviously vary quite a bit, like you might sometimes get numbers that are products of lots of small primes, lots and lots of divisors and primes only of 2, but on average it's about this. So next we can try the number sigma 1 of n. So this is going to be the sum of the divisors. So instead of counting the divisors, we're now adding them up. And we can write sigma 2 of n. This is now going to be the sum of the squares of the divisors. And similarly, we get sigma k of n. And you can probably figure out what that is. It's just the sum of the kth powers. In particular, sigma 0 of n is just the sum of the zeroth powers of the divisors, which is just the number of the divisors. So that's why sigma 0 of n is used for the number of divisors. So let's just start by working out some values for n from 1 up to 10. So sigma 1 of n goes something like 1, 3, 4, 7, 6, 12, 8, 15, 13, 18. I hope I've worked those out right. And sigma 2 of n looks like 1, 5, 10, 21, 26, 50, 50, 85, 91, 130. Now we can ask, are these multiplicative? Well, we can have a quick check. If it's multiplicative, then f of 6 would have to be f of 2 times f of 3. So we have a quick look. Well, here f of 6, in both cases, is indeed f of 2 times f of 3. So this is quite promising. It suggests these might actually be multiplicative functions. So let's actually check this. Let's first do sigma 1 of n. So let's try and calculate sigma 1 of n. Well, let's suppose that n is equal to p1 to the n1 times p2 to the n2 and so on. And a divisor looks something like p1 to the a1 times p2 to the a2 and so on. So we want to sum these over all a1, a2 and so on with nought less than or equal to ai is less than or equal to ni. So how do we do that? Well, let's look at the following sum. Following product, we take 1 plus p1 plus p1 squared up to plus p1 to the a1. And let's multiply that by 1 plus p2 and so on plus p2 to the a1. Let's multiply that by 1 plus p3 and so on. And if you multiply out this product, you can see that this product is equal to the sum over all choices of exponents. So this sum is just the same as this product here. And we can work out what this product is. This is a geometric series. So it's p1 to the a1 plus 1 minus 1 over p1 minus 1 times p2 to the a2 plus 1 minus 1 divided by p2 minus 1 times various other things. So there's a formula for the sum of the divisors of every number. And now you notice that this is multiplicative that sigma 1 of mn is equal to sigma 1m times sigma 1 of n. Because if m and n are co-prime, then the terms for m and the terms for n kind of don't interfere with each other. So the sum of the divisors of a number is a multiplicative function. For the sum of the squares of the divisors, it's kind of similar. So sigma 2 of n, where n is equal to p1 to the n1 times p2 to the n2 and so on. This time we need to take 1 plus p1 squared plus p1 to the 4 plus p1 to the 2n1 and multiply it by 1 plus p2 squared and so on times 1 plus p3 squared and so on. And this product will be the sum of squares of divisors. So we get a formula for the sum of the squares of the divisors in much the same way. We find sigma 2 of n is the product over all primes dividing n. This is a common way of writing a product over primes dividing a number. This would be just the product of all the primes of p to the 2 times np, whatever the exponent of that is, plus 2 minus 1 divided by p squared minus 1. And again this shows that sigma 2 is multiplicative because again if m and n are co-prime then these expressions don't interfere with each other. So we can write sigma 1 of n as being the sum over all divisors of n of d and sigma 2 of n is the sum over all divisors of n of d squared. So as before this notation means you're summing over all numbers d that divide n. And now these things here are certainly multiplicative functions of d. And we'll see next lecture that more generally if f of n is multiplicative then so is the function given by sum over d divides n of f of d. So this sort of explains why sigma 1 of n and sigma 2 of n are multiplicative. They're sums over the divisors of n of certain multiplicative functions. Now let's look at some arithmetic functions that aren't multiplicative but have a slightly different but related property. Here we're going to put little omega of n is the number of distinct prime divisors of n and big omega of n is the total number of primes dividing n. So for instance if you take 12 this is 2 squared times 3 so omega of n is just 2 because there are just two primes 2 and 3 but big omega of n is going to be 2 plus 1 because we're taking the sum of the two exponents to get the total number of primes countered with multiplicities. And these are generally quite similar functions. I mean if we sort of look at n being 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10 then little omega of n goes 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, whereas big omega goes 0, 1, 1, this time we have 2, 1, 2, 1, 3, 2, 1. So so they're quite often the same unless n happens to be divisible by a square or a cube or something in which case this one is a little bit bigger. Now these functions are obviously not multiplicative but they have a slightly different closure related property that they are additive. You can see that omega of m, n is equal to omega of m plus omega of n whenever m and n are co-prime. This is sort of obvious. And big omega is strictly additive which means that big omega of m, n is equal to omega of, so big omega of m plus big omega of n for all m, n. And additive arithmetic functions aren't really that much different from multiplicative ones because if you just sort of exponentiate an additive function you get a multiplicative one. And then we can ask questions like, you know, what are the average values of these functions? So let's ask what is the average number of primes dividing an integer? So, you know, if you, you know, some people have a sort of hobby of, you know, if you're walking along and feeling a bit bored you can factorize the numbers of car number plates that pass you. And you notice that what happens is there are usually only a very small number of prime factors, one, two, or three or something. So the number of primes dividing an integer seems to be pretty small. So let's work out what it is. So we can ask what is, well we can't take an average over all integers because that's going to be infinite, but we can take omega 1 plus omega 2 plus omega n over n. So we can look at the average of the number of primes dividing numbers for all numbers up to some fixed number n. Well, we can't really find an exact formula for this very easily, but we can estimate it roughly. So 2 is going to divide about half of the numbers from 1 to n. So let's write n over 2. And then we get n over 3 plus n over 5 plus n over 7 and so on up to plus n over p over n. So let's just remember what these bits are. So this is, this means about half of the numbers from 1 to n are divisible by 2 and similarly about a third are divisible by 3. So the total number of primes dividing all the numbers from 1 to n will be about this sum here. And here p is the largest prime less than or equal to n. So this sum is just a half plus a third plus a fifth and so on. So you're summing over the reciprocals of primes up to about 1 over p. And this is a little bit trickier to evaluate. You're not summing over reciprocals of integers. You're summing over reciprocals of primes up to some limit. And I'm just going to quote what it is. This is approximately log of n. This is shown by Euler using, it's a slight extension of his proof that there are an infinite number of primes. He not only showed that the sum of reciprocals of primes is infinite, but he also, by being a little bit clever, managed to estimate the partial sums. So how big is log log of n? Well, in theory, if you go to, you know, a calculus course, they'll tell you that the limit as n tends to infinity of log log of n is infinity. Well, this is theory. I'm here to tell you that that's not really true. In practice, log log of n is about three. Okay, so you're probably being a bit skeptical. So let's try it out. Let's work out some values of n and see what log log of n is. So for n is a thousand, log log of n is about 1.9. For n being a million, log log of n is about 2.6. A billion, it's about 3.0. 10 to 12, it's about 3.3. 10 to the 15, it's about 3.5. And you notice that all these values are about three. So yeah, I mean, in theory, log log of n sort of diverges, but in practice, it's done nearly constant. And what this means is that pretty much any number you try and factorize, unless it's ridiculously small or ridiculously large, will typically have maybe three prime factors. So let's have the last, today's last example of a multiplicative function is going to be Euler's totient function. Totient means just a number co-prime to n and less than it. So Euler's totient function phi or possibly phi of n, I'm never quite sure how you pronounce this, is the number of integers m such that one is less than or equal to m less than or equal to n and such that m and n are co-prime. So it's just counting things co-primes at m that are less than or equal to it. And again, we should start by making a little table of it just to see what it does. So if n is equal to 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, then phi or phi of n is 1, 1, 2, 2, 4, 2, 6, 4, 6, 4. So again, like most interesting arithmetic functions, it kind of jumps up and down quite a bit and there's a little bit difficult to study. So let's try and find a formula for it. Okay, well let's do a couple of examples first just so we can see what's going on. So let's work out phi or possibly phi of 12. So let's write down all the numbers from 1 to 12 and figure out which of them are co-prime to it. So I'm going to write down the numbers in a slightly funny way. So let's say 2, 4, 6, 8, 10, 12, 3, 9, 1, 5, 7, 11. So here are the numbers from 1 to 12 written out in a rather stupid order. And we want the numbers that are co-prime to 12. So we should start by throwing out the ones divisible by 2. And there are 12 over 2 of these. So we want to throw them out. So we start with 12 numbers and then we should subtract 12 over 2. We don't want those. Those are divisible by 2. And then we should throw out the ones divisible by 3. 3 being the other prime dividing 12. So and there are 12 over 3 of these. So we subtract 12 over 3. But we've over counted because we threw out 6 and 12 twice. And there are 12 over 6 of these. So we should add in 12 over 6. So 5, 12 is equal to this number here, which is 4. And you see there's 1, 5, 7 and 11 left over. And now we can simplify this expression slightly because it's 12 times 1 minus a half times 1 minus a third. So we're sort of throwing out the numbers divisible by 2 and then throwing out the numbers divisible by 3 and being careful not to throw things out too many times. So here we have a sort of, we have to remember to keep track of how many times we're throwing out numbers. So let's see what's going on. Let's do this in a slightly more complicated example. Let's work out 5 of 30, which is 2 times 3 times 5. So this time we've got 3 primes to keep track of. So let's see what we've got. So here we've got, we should put in multiples of 2. And here we should put in multiples of 3. And here we should put in multiples of 5. And the things that are multiples of all of them are just 30. And here we get 15. And here we get 10, 20. And here we get 6, 12, 18, 24. And here we get the multiples of 2 that have nothing to do with 3 or 5. And we get 2, 4, 8, 14, 16, 22, 26, 28. And here we get 3, 9, 21, 27. Here we get 5 and 25. And now we need to figure out how many numbers are left over. Well, well, I mean the ones left over 1, 7, 11, 13, 17, 19, 23, 29. So all together we've got 30 numbers here. And then the ones we need to throw out, we need to throw out 30 over 2. And we need to throw out 30 over 3. And we need to throw out 30 over 5. And then we need to add back in 30 over 3 times 5. And this is getting a bit complicated. Let's write it down. So it's 30 times 1 minus a half minus a third minus a fifth. So we need to throw out multiples of 2, 3, and 5. And then we need to add back in the multiples of 1 over 2 times 3 plus 1 over 3 times 5 plus 1 over 2 times 5. So we have to add in these and add in these and add in these. And now if you check, we've thrown out 33 times. But then we added it back in three times. So we've got to throw it out again. And now you see this is just 30 times 1 minus a half times 1 minus a third times 1 minus a fifth. And now you can see what's happening in general. If we've got a number p, which is number n, which is p1 to the n1 times p2 to the n2 and so on, then phi of n is going to be n times 1 minus 1 over p1 times 1 minus 1 over p2 and so on. And you can think of this as being probabilistic. So this is the chance of a number being co-prime to p1. And this is the chance that it's co-prime to p2. And what you're saying is that if you sort of pick a random number from 1 to n and you ask for it to be co-prime, well, the chance of that happening is the chance of it being not visible by p1 times the chance of it not being divisible by p2 and so on. So this is the total chance of a number from 1 to n being co-prime to n. So the total number should be that. So in particular, you see from this formula that phi is multiplicative. This game was one of Euler's first theorems about phi. So we've got a formula for it and we've shown that it's multiplicative. I think I'll give a little exercise if you want to play around with this a bit. Let's find all numbers n with phi of n equals 24. Okay, so one good way of handling multiplicative functions. Well, if you've got a function of the integers f of n, you can try forming a power series f0 x to the 0 plus f of 1 x to the 1 plus f of 2 x to the 2 and so on. You've probably seen how this can often be used to prove things about the function f. This doesn't actually work terribly well for the sorts of functions we have in number theory. It turns out it's often much better to form a Dirichlet series. So Dirichlet series is, so we don't start with nought, we start with 1, f1 over 1 to the s plus f2 over 2 to the s plus f3 over 3 to the s and so on. So let's call this big f of s. So what we're going to do in next lecture is to study these Dirichlet series as a way of studying multiplicative functions.