 This lecture is part of Berkeley Math 115, an introductory undergraduate course on number theory and I will be talking about Euler's five function or Toschent function So the first question is what does Toschent mean and the answer is Toschent doesn't really mean anything at all It was just a name made up by Sylvester for Euler's Toschent function Sylvester is a sort of habit of making up large numbers of funny names for mathematical functions So let's recall what Phi of n is so Phi of n is the number of Residue classes Mod n that are co-prime to n and Let's just stop by Making a quick table of it just to get an idea of how it behaves So let's take n to be zero one two three four five six seven eight nine and ten shouldn't have zero and Let's list the residue classes of the co-prime to n well for one There's only one residue class co-prime to one which is zero for two We just get one for three we get one two four we get one and three five one two Three four six we get one and five seven one two three four five six eight We get one three five seven nine one two three four five six seven eight and ten we get one Two doesn't count three four five six. No seven Yes eight no nine yes, so now we can work out what five n is it goes one Um Sorry starts one one two two four two six four six four and you can see from this tablet It's really a rather jumpy function. It sort of keeps bouncing up and down all the time There are some obvious Things you can say about it for example if p is primed and Phi of p is obviously p minus one You can see this so five seven is six because all non zero residue classes are co-prime to it So what we want to do is to calculate by even when Five n for none prime values of n. So let's see how we do this The first key point is that five mn is equal to five m Times five n. Well, you may be a bit suspicious of this If you look at my table, you see this is actually false for instance fire four is not five two times five two That's because I I missed out the condition that m and m a co-prime You remember functions like this are called multiplicative So so multiplicative So you might think multiplicative should mean this always holds but it turns out to be more convenient to say it only holds when m and n are co-prime and This follows from the Chinese remainder theorem that we just covered and the key point is that a pair a b With if we've got a pair a b where a is mod m and B is mod n Then this corresponds that then these correspond to numbers c modulo mn And then we can see that c is co-prime To mn if and only if a is co-prime To m and b is co-prime To to to n so here remember we're taking m and n to be co-prime So you met so that follows because a is just c modulo m and b is c modulo n So the number of things co-prime to mn, which is five mn is now just the number of things co-prime to m Which is five m times the number of things co-prime to n Let's be so here We're using the Chinese remainder theorem to give a correspondence between residue classes modulo m and n to residue classes mod mn And the Chinese remainder theorem only works when m and n are co-prime So so this formula doesn't usually hold if if m and n are not co-prime So now we can work out by of n for any n So suppose n is equal to p1 to the n1 times p2 to the n2 times p3 to the n3 and so on So what is five n? Well, this will be five p1 to the n1 And five p2 to the n2 and so on so this reduces to the case of prime powers Well prime powers are easy because phi of p to the m We just want the numbers from zero up to e to the m minus one with a co-prime To p to the m. Well, this just means not divisible by p and the number that are divisible by p is obviously just p to the m minus one because Because these just p times Anything up to p to the m minus one So the number that are not divisible by p to the m is just p to the m minus p to the m minus one Which is equal to p to the m times one minus one over p so This shows us what five n is so five n is just p1 to the n1 minus one times p1 minus one Times p2 to the n2 minus one times p2 minus one and so on which you can write as being n Times one minus one over p1 times one minus one over p2 and so on So we have a nice formula for phi of n whenever we know the prime factorization of n I want to give a couple of other different ways of thinking about this formula So another way of calculating phi of n is by the inclusion Exclusion principle and actually this is mainly a way of introducing the inclusion exclusion principle which is a Neat way of counting things. So let's first of all do five of six Well, well five six is going to be Well, you start with taking six and then you have to throw away the number of elements divisible by two So number of elements divisible by two is six over two And then we have to throw away the number of elements divisible by three because these aren't co-prime to six either So we subtract six over three But then we thrown away too many because we've thrown away the elements six twice So we have to add in the elements divided by six So five six ends up looking like this and if you think about it This is just six by one minus a half by one minus a third In fact, you can see this sort of by drawing a Venn diagram. So here are the Residue classes divisible by two We have three of them two four and six and here are the residue classes divisible by three and Here are the residue classes not divisible by by by anything. So we've we've Taken the all the residue classes one two three four five and six and then we've thrown out the ones divisible by Two which correspond to those ones there and then we throw out the ones divisible by Three which are these ones here and then we've thrown out the number six too much So we have to add it back in again. So these things are added back in here And now just sort of do the case 30 to show you a slightly more complicated one. So supposed to be look at by 30 So what we do is we write down all the residue classes up to 30 so we're going to have ones divisible by Two or three or five and So the ones divisible by two three and five we're just gonna get 30 there And the ones divisible by two and three are going to be multiples of six. So we get six 12 1824 and here we're going to get ones divisible by three and five which is 15 and 13 here we get two and five So we get 10 20 and here we get the ones divisible by five which aren't divisible by two or three. So we get five 10 15 20 25 I guess and here we get multiples of three not divisible by two or five and I'm getting a bit confused by this I'll probably get them wrong. So we get three Six no nine. Yes 12 no 15 no 18 no 21 yes 27 yes and here we get two four six eight ten 12 No 14 yes 16 22 26 28 I think and the ones left over are one seven 11 13 17 19 23 and 29 so again we see that fire 30 Is equal to 30 and then we subtract 30 over 2 which are these ones then we subtract 30 over 3 Which are these ones then we subtract 30 over 5 which are these ones then we throw away these ones too much So we have to add in 30 over 2 times 3 and then we have done 30 over 2 times 5 plus 30 over 3 times 5 and then we notice that these ones here we we threw them away Three times, but then we added them back in three times and we should only have added it back in twice So we have to subtract 30 over 30 to throw away this one again and the inclusion Inclusion exclusion principle works like this when you're counting things with Very various properties you have to first of all So if you're trying to count the number of things without one of several properties you first of all Throw out the number with properties a and properties b and properties c then you add in back the number Which are property a and property b and so on then you throw out the number with three of these properties And if there were four properties, we would then have to add back in the ones with four properties and so on And again if you look at this this expression here can be written as 30 times one minus a half Times one minus a third times one minus a fifth because if you multiply it out get all these factors There's an interpretation of this by probability So Let's stick with the number 30 again and try and work out the number 30 we want to work out what is the chance There's a number is co-prime 230 for the probability And this means that there are sort of three ways it could not be divisible by 30 method a is it might be divisible By two and method B second problem is it might be divisible By three or it will see it might be divisible By five and what's the probability that a number is divisible by two? Well, that's obviously a half and the probability that's divisible by Three is is a third and the probability is divisible by five as one fifth and the key point is these are independent events so in probability two events are called independent if the probability that They both occur is equal to the probability that the first occurs times the probability that the second occurs So if we've got three events and we will want them to be we will want any two of them to be independent We would have P B and C would have to be P of B times P of C and P of a and C would be P of a Times P of C and you've got to be a bit careful here because that's means any two of the events are independent But it's possible That the three of them are correlation. I'll give an example of this a bit later So we also need to add the condition that the probability that all three events occur is probability of a times probability of B times probability of Of C Anyway So if we want to work out the probability that no events occur So the probability that none of a B and C occur It's just the probability that a or B or C Sorry, it's just the problem. It's it's It's just given by one minus the probability that a occurs minus the probability that B occurs minus the probability That C occurs plus the probability that a and B occur and so on and Since a B and C are independent events. This is just One minus the probability that a occurs times one minus the probability that B occurs times One minus the probability that C occurs. So now particular case This is going to be one minus a half times one minus a third times one minus a fifth So this is the probability that a number is co-prime to 30 in some sense So the number of numbers less than 30 The co-prime to 30 is going to be 30 times this which is 30 times one minus a half times one minus a third Times one minus a fifth which you can figure is it is just eight And so I mentioned that with probability arguments you've got to be a little bit careful about independence So I want to give an example where three events are pair-wise independent, but but All three together are not independent. So so for this I'm going to take I'm going to suppose there are four events The events I'm going to call zero one two and three so And they might be equally problems. So you so you might have a four-sided die and That to give an example of this suppose for example, you have been say kidnapped by an insane probability theorist Who who's going to rock, you know, so you're in prison in your cell He's going to throw this four-sided die and you have to Guess whether the number he gets is even or odd so If you manage to guess correctly, he will let you go and if you don't he will shoot you There's a big incentive to try and guess correctly Well, so he rolls the four-sided die and you have to guess and you know, you know, you've no idea You don't have any information about this could There's a 50-50 chance that it's even and a 50-50 chance that it's odd. So so our first event is So then a is supposed to die is zero or two. Well Fortunately, you've got some help because there's a guy in a cell to the left of you and he can sort of squint at the die and he thinks The number is either zero or one because you know, maybe the numbers zero and one are sort of written in red And he can sort of see the numbers ready So so he tells you very helpfully that he's pretty sure the die is either zero or one and does that help you No, it doesn't it gives you no useful information about the probability That the number is zero because even if you know the number is zero or one, there's still a 50-50 chance that it's even So so the probability of a intersection B is equal to the probability of a Times the probability of B. So the probability of a is Half and the probability of B is a half and the probability that A and B both occur as a quarter. So so that means these two events are Independent and knowing B isn't helpful if you're trying to figure out a Well, okay Well, there's a guy in the cell on the other side of you and they're pretty sure that the number is either zero or three for some weird reason and You know, it doesn't knowing that help at all Well, no again the probability of a intersection C is the probability of a times the probability of C So so just as you know the guy at the information the guy on the left wasn't any use because these events are independent and same The information of the guy on the right doesn't seem to be any use because you know, it's just just changed one to three however, if If you combine the information from these guys to the left on the right of you So one says it's zero or one and the other says it's zero or three Now now suddenly you know what the result is, you know, it must be zero And you notice the probability of a intersection B intersection C is not equal to the probability of a Times the probability of B times the probability of C So so what we have here are three events and you can check that any two of these events are actually independent events But all three of them become dependent So when you're, you know doing these arguments of probability have to be very careful About these sorts of slightly paradoxical Things in fact probability is full of weird unintuitive paradoxes and basically unless you've been trained in a probability course You should be extremely wary about all arguments using probability So anyway, so we've now got a formula for phi of n Let's just try out an example. So let's try and work out what What is phi of 10 factorial? Well, all we have to do is to work out the prime factorization of 10 factorial So this is 2 times 3 times 4 which is 2 squared times 5 times 6 Which is 2 times 3 times 7 times 8 which is 2 cubed times 9 which is 3 squared times 10 Which is 2 times 5 so we multiply this off This is equal to 2 to the power of 1 2 3 4 5 6 7 8 If I get this wrong It's it's of course a deliberate error to see if anyone's paying attention then we get 3 to the power of 1 2 3 4 Then we get 5 to the power of 2 and we get 7 to the power of 1 so phi of this would be 2 to the 7 times 2 minus 1 3 cubed times 3 minus 1 times 5 to the 1 times 5 minus 1 times 7 to the 0 times 7 minus 1 I'm not going to bother to work this out because not totally exciting So working out phi is very easy if you know the prime factorization So let's do a couple of Slightly less trivial examples. Let's find all numbers n With 5n equals 24 So let's think about this. Well, obviously the first thing you do is look at the prime factorization of 24 Which is 2 times 2 times 2 times 3 and This has to be phi of n Well n is going to be a Product of things the form p to the a and p to the a is going to give you p to the a minus 1 times p minus 1 so All of these things Will have to sort of combine into things like p to the a minus 1 and p minus 1 and you notice In particular p minus 1 must be a factor of 24 So what are the factors of 24 we have 1 2 3 4 6 8 12 24 so One of these must be p minus 1 so the possible choices of p are 2 Or 2 or 3 or 4 isn't a prime so that's no good or 5 here We get 7 9 isn't a prime so we get 13 so the possible primes are these And you notice we can't get 5 squared because that would mean we would have to have a factor of 5 here We can't get 7 squared and we can't get 13 squared But we could perhaps get 3 squared so and and we could get 2 to the power of Well, you imagine we could get up maybe up to 2 to the 4 So so the number n is going to be 2 to the 0 1 2 3 or 4 times 3 to the 0 1 or possibly 2 times 5 to the 0 or 1 times 7 to 0 or 1 times 13 to the 0 or 1 So it's going to be one of these numbers here and of course it can't be all of them because you know if you've got if you've got 13 to the power of 1 and that's going to use up a couple of twos and a 3 that you can't use for anything else So so the numbers are quite restrictive And in fact if you if you go through it systematically You find you could get the numbers of 13 times 2 squared so if you have a 13 then that uses up Two of the two is one of the three So we've just got a two left over and we can we can get a single two by having a 13 times 2 squared or a 13 times Three or we could even get a 13 times 3 times a 2 because we can you know You can sort of add an extra 2 to our nod number without increasing without increasing 5 So that's all the ways you can get using 13 then we go through all the ways using 7 and we get 7 well We could have a if you've got a 7 we used up a 2 and a 3 So we've got to somehow use up two more twos and we can do that by having a 2 cubed or a 5 or a 5 and a 2 or a 2 squared under 3 and I think that's that's about all the ways I can think of using up 7 Or we could have a 5 and if we have a 5 that uses up 2 twos So we've now got to get rid of a 3 and a 2 we can get it by having 5 times 3 squared or 5 times 3 squared times 2 And I can't think of any other ways of using up the 2 and the 3 So so that's all all the ways with the 13 and a 7 and a 5 Now I've got to go through all the ways of doing it with Some twos and threes well, we need a we need a 3 squared to account for the 3 And that uses up a 2 and then we have To account for 2 twos left over and that we can do with the 2 cubed so we get 1 2 3 4 5 6 7 8 9 10 ways of doing this By the way, there's a problem called the Carmichael conjecture Which says Given n and we find M not equal to n with 5 m equals 5 n And as far as we know the answer is always yes and people have done sort of Searches and it's known that any n without this property must have at least 10 billion digits I don't mean that n is at least 10 billion I mean n has at least 10 billion digits in it so it's at least 10 to the power of 10 billion so so counter examples must be Unbelievably huge and to see what the problem is you notice that suppose n is odd Then 5 n must be equal to 5 to n so so for any odd number. There's another number With this with the same value of fine similarly if n is 2 modulo 4 Then you can divide it by 2 and find something with another number. So n must be divisible by 4 and By using lots of other similar arguments to this you can easily check that n must be divisible by lots and lots of other Primes and you can get so many primes dividing n that n has to be Unbelievably huge, but no one's ever managed to manage to actually Prove that you can't find such an n Carmichael thought he'd proved it, but then you notice an error in this proof so turned into a conjecture So Another similar example is can we find numbers with 5 n power of 2 This is of some historical interest and because Gauss showed that we can construct Regular n-gon with ruler and compass If and only if 5 n is a power of 2 I mean constructing a regular n-gon with rule and compass is of course rather pointless But it's Was a sort of old problem old geometrical problem. So we want 5 n to be 2 to the k and Let's suppose n is equal to a product of primes p1 to the n1 p2 to the n2 and so on so Phi of n is going to be p1 to the n1 minus 1 times p1 minus 1 and And so on and we notice from this that if P i is not equal to 2 then n i must be equal to 1 because otherwise the number 5 n would be divisible by p i We also notice that p i minus 1 is a power of 2 So it must be a firm up rhyme So we see that n is a power of 2 times p1 times p2 and so on where these are distinct Firm up primes You remember firma prime is one that's one that's such that p minus one is a power of 2 and Conversely if n is of this form you can immediately see that 5 n is a power of 2 so that the numbers that can be constructed by ruler and compass are exactly the form 2 to the n times a subset of the firma prime such a 3 5 17 257 655 37 So the first few of these are 1 2 3 4 5 6 8 10 15 16 and so on and so the Greeks knew how to construct Polygons with these number of sides and the first new one was found by Gauss who noticed That you could construct a 17 sided polygon by ruler and compass and he was a teenager when he discovered that So we can also ask how big is 5 of n or how small is it Well an obvious oppa the upper bound is pretty obvious So 5 n is certainly less than n at least when n is not equal to 1 Which is a kind of trivial case and 5 p is p minus 1 for p prime So So we can look at 5 n over n and we know this is less than 1 and it gets very close to 1 Because whenever n is prime it can be sort of as close as you like to 1 so Congress we can ask how small And 5 n over n get Well 5 n Over n is equal to 1 minus 1 over p 1 Times 1 minus 1 over p 2 and so on where the p i or the primes dividing n So obviously for 5 n to be small compared to n we want n to be divisible by lots of small primes and This makes it obvious how to find numbers with 5 n quite small we can take 2 We're 5 n over n is a half or we can take 2 times 3 where 5 n over n is now 1 over 2 times A Half times two-thirds which is third The next one is 2 times 3 times 5 which is 30 and here we get 8 over 30 and 2 times 3 times 5 times 7 which is 210 And so so the numbers with 5 n being unusually small it just the product of the first few primes So we can ask can we make this number as small as we like could we make it less than say 1 over a hundred Well in order to answer this we need to know how small and The number 1 minus a half times 1 minus a third and 1 minus a fifth and 1 minus a seventh and so on get so You can imagine two things happening one it could just get smaller and smaller and smaller And get this closest like to zero or there might be some lower limit to it which is correct Well, we can figure this out by looking at its inverse 1 over 1 minus a half times 1 over 1 minus a third 1 over 1 minus a fifth and so on and if we multiply this out Well, this is equal to 1 plus a half plus 1 over 2 squared plus 1 over 2 cubed and so on Times 1 plus a third plus 1 over 3 squared and so on all the way up to times 1 plus 1 over p Plus 1 over p squared and so on and this is going to be some sort of big sum of 1 over various integers and You see that that this is going to be a sum over all n such that all prime factors of n a less than a week to p Because every time you you multiply these numbers together you have to pick one number from this one and one from this one and one from this one So you'll get one over one over n where n is some power of two times some power of three and so on so this is going to be at least some of some over n Less than or equal to p of 1 over n So Now we remember from calculus that the series one plus a half That's a third plus a quarter and so on tends to infinity And we recall you can see this very easily because this is greater than a half plus a half and the next four terms are all at least a quarter Sorry, that's not right. That's not bigger than a half. This is Sorry Is the long way around These two are bigger than a quarter and the next four are all bigger than an eighth So there should be two terms that are bigger than a quarter So the sum is going to be at least a half plus a half plus a half Plus a half and so on and since this goes on forever You can make the series as big as you like So the conclusion is the product over all primes of one minus one over p actually tends to zero That's become zero if you take all primes here So the conclusion is that phi n over n can be as small as you like provided But bigger than zero so you can make it less than say one over a million if you like However, in order to make it less than a million you'd need to end to be really Extraordinarily large because although this product tends to zero It doesn't tend to zero all that fast and you need to take a very very large number of primes in order to make this small We can ask a similar question, you know, what is the average value of Five n over n so we've seen we can make this close to zero as we like and it's obviously as close to one as we like Doesn't have a sort of average value and you can think of this as being the chance There's a number is Co-prime To n very roughly speaking well, this will obviously vary a lot depending on whether You know, it'll be close to one if n is prime and not otherwise and we want to sort of average this over all n So we can ask the following question. What is the chance? that two numbers M and n chosen at random are Co-prime Well, the first problem is that you can't choose two integers at random. It doesn't make a whole lot of sense So, you know, this this phrase chosen at random is Extremely dubious You know, if you want to choose numbers at random with every integer being equally likely you have to You know say that the chance of each integer must be Some number epsilon and you want epsilon to be the same for all integers Well, the sum of all the silence has to be one so epsilon has to be zero So the chance of any integer being chosen is zero and it doesn't make sense to choose integers at random So whenever you see the phrase choose an integer at random, you want to be a little bit nervous But you can sort of make sense of this suppose you choose M and n to be Chosen at random from the integers less than or equal to some big number capital N This makes more sense. Although the answer may of course depend on capital N Well, let's see if we can answer this and we want them to be Co-prime and what's the chance? They're not both divisible by two Well, this will be one minus quarter because there's a one and four chance that they're both divisible by two What's the chance? They're not both divisible by three Well, this will be one minus one over three squared because there's a one and nine chance They're both divisible by three and similarly the chance. They're not both divisible by five is one minus one over five squared and so on So what we really want is that the chance that they're co-prime is going to be the chance They're not divisible by any by any By any prime so we multiply these all together and we find that the the probability That M and N are co-prime Is going to be about one minus one over two squared times one minus one over three squared times one minus one over five Squared and so on where this is a product over all primes Okay, I've done a certain amount of fudging here because I said we're going to take M and N less than equal to some big number capital N And obviously if we fix capital N the chance isn't going to be exactly that because first of all We should cut off at primes bigger than capital N and secondly the chance is Not going to be exactly one oh one minus one over three squared unless three divides N and so on so There's some fudging going on, but we will just ignore that And now we want to know what happens to this product. Does it tend to zero or does it tend to some limit? So you remember formerly we saw that one over one minus two times one minus one over three and so on Tends to zero so you might think the same happens for this And in fact it doesn't If we work out this sum here, we can take its inverse just as before and we get one plus One over two squared plus one over two to the four and so on and then we multiply it by one plus one over three squared plus one over three to the Four and so on do the same for all other primes Now we multiply together all these expressions and we get the sum over all integers n of one over n squared because every integer n can be written as a product of The power of two and a power of three and a power of five and so on so if you multiply together all these infinite sums You get this sum here and the sum of one over n squared is actually convergent You can see it's convergent by say using the interval test because you know the integral of one over X squared from one to infinity The X is finite and Euler rather incredibly managed to evaluate this sum and found it's equal to six Pi squared over six I'm not going to Show that it's pi squared over six at least not in this lecture because that involves a certain amount of analysis So that's the inverse of this product here. So this product here is actually six over pi squared So the chance that two numbers are co-prime is actually six over pi squared, which is absolutely bizarre I mean that the you seem to have a problem about You know Straightforward problem in number three. What is the chance that two numbers are co-prime and all of a sudden the number of pi? Is is popping up out of nowhere? Um so Just have a final slide on By what is what does this generating function look like? Well generating function means you form a power series sum of x to the n times phi n So you can think of this as being a function and it actually converges for x something absolute value less than 1 So what properties does this function have? Well, I've no idea. I mean, it's an absolutely ghastly function Phi jumps up and down and this is very difficult to control So the generating function like this is not terribly useful However, there's another way of forming a generating function. This is very much better where we form sum over phi n over n to the s So this is Phi of 1 over 1 to the s plus phi of 2 over 2 to the s and so on and There's a much night that there's a very simple expression for this. This turns out to be zeta of s minus 1 Over zeta of s where you recall zeta is the Riemann zeta function Zeta of s equals 1 over 1 to the s plus 1 over 2 to the s and so on um and Um We can see this by Just Recall we had Oilers product for zeta of s. So this is equal to 1 over 1 minus 2 to the minus s times 1 over 1 minus 3 to minus s times 1 over 1 minus 5 minus s and so on I mean, you notice by the way, we actually use this Oiler product twice already this lecture for s equals For s equals 1 and s equals 2 Well, this means that the zeta of s minus 1 is Equal to the product of 1 over 1 minus 2 to the Sorry, 1 over 1 minus p to the 1 minus s where we're taking product over all primes so Zeta of s Minus 1 over zeta of s just becomes a product over all primes of expressions like this 1 plus p minus 1 over p to the s plus p times p minus 1 Over p to the 2 s and so on and now you notice that this thing is 5 p And this thing is 5 p squared and so on And now we use the fact that 5 m n is 5 m times 5 n whenever n whenever m and n are co-prime in order to see that this is just equal to the product sum over all n of 5 n over n to the s So Oilers 5 function has a nice generating function, but you need to use these To re-clay series rather than power series in order to get a nice expression for it for later use we will be using the following Formula which I think is due to Gauss or possibly oiler which says that sum over d divides n by of D is Equal to n So that is surprising when you first see it In order to understand why this is true. Let's just take a look at the case n equals 12 So I'm going to write out the residue classes modulo 12 So we have 12 residue classes one two three four five six seven eight nine ten And now I'm going to divide them up according to The What what is the greatest common divisor of a and 12 so a 12 could be It could be one two three four six twelve So let's see how this works. Well the ones with highest common divisor one a one five seven and One I stopped at ten there and 11 once the highest common divisor two are two and Ten highest common divisor three we get three and nine highest common divisor four we get Four and eight and highest common divisor six we get six and highest common divisor 12 we get 12 so here I've divided up these 12 numbers into Six classes according to the highest common divisor and now we we count how many there are well here There are going to be five of 12 of them here. There are five six either of five of Four if they're a fight of three fight of two and five of one So what we notice is that the number of residue classes With a 12 equals D is just phi of 12 over D and the reason for that is that The residue classes with highest common divisor D are just the residue classes Co-prime to 12 over D multiplied by D. For instance, you see these residue classes here are three times one and three times three and one and three are the numbers Co-prime to 12 and here we get the numbers two times one and two times five and One and five are the numbers co-prime to six and Exactly the same works for any number N So phi of N over D is the number of residue classes A mod N With a N Equals D and that's because these residue classes are just D times a 1 D times a 2 and so on where a 1 a 2 are the numbers Lesson or equal to N over D that a co-prime To N over D So the number of these is just phi N over D So the total number of residue classes mod N and the number of residue classes mod N is of course just N is Just equal to sum over all numbers D dividing N phi of N over D And this is just the same as the sum D divides N of phi of D Because you can just change D to N over D as as D runs through the devices of N N over D also runs through the devices of N Incidentally this formula and that The sum of the devices the sum over the devices of phi D is equal to N actually determines the function phi By by by induction because you can see you can now write phi of N is Equal to N minus the sum over D divides N where D is less than N Phi of D. So phi is the only function that satisfies this formula here So we'll later be using this formula when we discuss primitive roots. So don't forget it Okay, that's all about Euler's totient function