 This lecture is part of Berkeley Math 115, an introductory undergraduate course on number theory, and will be a little bit more about Hensel's Lemma, or Newton's method, and a little bit about periodic numbers. So I'll just recall what we were talking about concerning Hensel's Lemma in the previous lecture. So the idea was we wanted to solve f of x is conglomerate to zero, mod p to the n for sum n. And you remember if we had a solution f of x1 is conglomerate to zero, mod p to the n, we can try and find the solution mod p to the n plus one. And we remember if we put x2 is equal to x1 minus f of x1 over f prime of x1, then this will be a better solution provided f prime of x1 is not conglomerate to zero, mod p. And the problem I'm going to discuss now is what happens if this condition here is not satisfied. So what if f prime of x1 is conglomerate to zero, mod p? So as an explicit example of this, we might look at x squared is conglomerate to, say, 17 mod 2 to the n. And here our polynomial is f of x equals x squared minus 17. And f prime of x is equal to 2x. And we notice that this is going to be conglomerate to zero, modulo 2. So it looks as if we can't use Newton's method or Hensel's lemma to solve this. However, we can if we are a little bit more careful. So suppose we have a solution x1 with f of x is conglomerate to zero, mod p to something or other. And suppose f prime of x1 is not conglomerate to zero, modulo p. Then we have f prime of x1 might be divisible by some number p to the d, but not by p to the d plus 1 for some d. So we're taking the highest power of p that divides the derivative. So d equals zero is the case we have already done, where f prime of x is not divisible by p. Now, if we look at f of x minus f of x over f prime of x, so you remember this is the improved solution using Newton's method. Well, we can write this out as f of x, sorry f of x plus f prime of x times minus f of x over f prime of x. So here we're writing out the first few terms of the Taylor series expansion of this. So then we have the second derivative of f over two factorial times minus f of x over f prime of x or squared plus higher terms. And as in Newton's method, these two cancel out. So the first two terms are zero. And suppose f of x is conglomerate to zero, mod p to the n for some n. Then we want this to, then this will be divisible by p to the 2n divided by p to the 2d. And so we want this to be divisible by at least p to the n plus 1. So we want to get an improvement. So we need 2n minus 2d has to be greater than or equal to n plus 1. So we find n is greater than or equal to 2d plus 1. So this shows when we can use Newton's method in these more special cases. So summary, suppose f of x is conglomerate to zero, mod p to the n. And f prime of x is divisible by p to the d, not by p to the d plus 1. And suppose n is greater than or equal to 2d plus 1. Then, let's call this f of x1, then f of x2 will be conglomerate to zero, mod p to the n plus 1, where x2 is given by the Newton's method. x2 is equal to x1 minus f of x1 over f prime of x1. Notice that if d is equal to zero, this is the previous case we had. We want f prime of x1 is not divisible by p, which is p to the zero plus 1. And we want f of x1 is conglomerate to zero, mod p to the 1, or p to the n. And the condition is that just n is greater than or equal to 1. So in this case, 2d plus 1 is just equal to 1. So the previous case of Newton's method is a special case of this more general method. So let's apply this to the old problem of when can we solve x squared is conglomerate to a, mod 2 to the n for n large. And we're going to take a to be odd. And here we look at the polynomial f of x is equal to 2x minus a. So f prime of x is equal to 2. So this is divisible by 2 to the 1, not by 2 squared. So we take d equals 1 and we find the condition n has to be greater than or equal to 2d plus 1, which is equal to 3. So if x squared is conglomerate to a, modulo 2 cubed, here we're taking a to be some odd number, then we can solve, then we can lift to x squared is conglomerate to a, modulo 2 to the 4, 2 to the 5 and so on. Of course, Newton's method won't be increasing the exponent by one each step. It will increase the exponent by one, then by two, then by four and so on, because it gets faster as you go on. Well, so we ask when can we solve x squared is conglomerate to a, modulo 2 cubed? Well, that's easy enough. We just check all possible cases. Let's suppose x is equal to 1, 3, 5 or 7 mod 8 because we're only looking at odd numbers, then x squared is going to be conglomerate to 1, 1, 1 or 1 mod 8. So for a odd as usual, we can solve x squared is conglomerate to a, mod 2 to the n for n large, if and only if a is conglomerate to 1, modulo 8. So we can contrast this with what happens if we're trying to solve x squared is conglomerate to a, modulo p. Again, we take p does not divide a. In this case, f of x is just 2x and we notice that if x is not conglomerate to 0 mod p, then this is not divisible by p because p is odd. So this factor of 2 doesn't matter. So we can take d equals 1 and provided if we solve x squared is conglomerate to a, mod p to the n, then we can solve x squared is conglomerate to a, mod p to the n plus 1 provided n is greater than or equal to 1. So this 1 is our number 2d plus 1. So for example, if we take p equals 5, we can solve x squared is conglomerate to a, mod p if and only if a is conglomerate to 0, 1, or 4, mod 5. So we can solve x squared is conglomerate to 0. So x squared is conglomerate to a, mod 5 to the n for n large, if and only if a is conglomerate to 0, or if a is conglomerate to 1 or 4, mod 5. This is for the case 5 does not divide a. If 5 does divide a, we've got to be a little bit more careful. So if we want to solve say x squared is conglomerate to 5 to the m times a for a odd for a not divisible by 5, modulo 5 to the n. Well, obviously what we can do is if m is even, we can just solve, we can just say x is equal to 5 to the m over 2 times the square root of a. And then we reduce the case when a is not divisible by 5. And if m is odd and n is sufficiently large, you see this doesn't have a solution. And so this gives a more or less complete solution to when we can solve x squared is conglomerate to a modulo p to the n. You can reduce it to the case when x squared is conglomerate to a modulo p to the power of 1, unless p is 2, in which case, as we saw, we need to check x squared is conglomerate to a modulo p cubed. So the summary of this is that using Hensel's Lemma or Newton's method, we can pretty much reduce the solution of conglomerate's modulo of prime power to solutions modulo of prime. Now I want to talk a little bit about p-addict numbers, which are a sort of way of putting this together. So you remember in the previous lecture, we were solving the equation x squared is conglomerate to 7 modulo 3 to the 100. And we remember we've got this series of solutions. So x is conglomerate to 1 mod 3 or x is conglomerate to 1 times 3 plus 1 mod 3 squared or x is conglomerate to 1 times 3 squared times 1 plus 1 times 3 plus 1 mod 3 cubed or x is conglomerate to 1 times 3 squared plus 1 times 3 plus 1 modulo 3 to the 4 and so on. And we can think of these numbers as being written out in base 3. So if I write them in base 3, these become x equals x is conglomerate to 1 or x is conglomerate to 1 1 or x is conglomerate to 0 1 1 1. And if we go on, we can find x is conglomerate to something like 1 1 2 0 0 2 0 1 1 1 mod 3 to the whatever it is 1 2 3 4 5 6 7 8 9. That would be mod 3 to the 10. And we can do this for any modulo 3 to the power of any finite number. And then you get the idea, why not just continue it forever? So we can say that a periodic number, let's be a bit informal, is just a number in base p that goes off to the left, an infinite distance. Now going off an infinite distance isn't so strange. Let's look at a real number like, like, like pi, for example, pi is equal to 3.1415926535. And this goes on at an infinite distance to the right. And you remember this is just short for saying pi is equal to 3 times 10 to the 1 plus 1 times 10 to the minus 1 plus 4 times 10 to the minus 2 plus 1 times 10 to the minus 3 and so on. And we just continue this series forever. And similarly, the periodic number 1 1 2 0 0 2 0 1 1 1, which goes off to an infinite number to the left, can be thought of as a shorthand form for 1 times 3 to the 0 plus 1 times 3 to the 1 plus 1 times 3 squared plus 0 times 3 cubed plus 2 times 3 to the 4 and so on. So here we have an infinite series of powers of 10, which is just a real number. Here we have an infinite series of powers of 3, and this is going to be a three addict number. And you may be a bit nervous about this because if you look at this series here, you think, well, this series doesn't converge. You know, you have all these tests for convergence in real analysis, and these terms don't even go to zero. So this does not converge. Well, it's true, it does not converge to a real number. There's no real number like this. However, it does converge to a periodic number. We've got a perfectly good periodic number that goes off an infinite distance to the left. And it turns out that for periodic numbers, high powers of 3 actually, in some sense, get smaller and smaller. I mean, if you think of a high power of 3 as being a real number, it's getting bigger and bigger and bigger. But if it's a periodic number, it's actually getting smaller and smaller and smaller because a high power of 3 has a lot of zeros here, followed by a 1. And the more zeros there are here, the smaller the periodic number is. So it's quite different from real numbers. With real numbers, if you have lots of zeros before the decimal point, it's becoming a big real number. But for a periodic number, it's becoming smaller. And it's the other way around for numbers to the right of the decimal point. So powers 10 to the minus 2 or 10 to the minus 3 becoming very small real numbers. But they're actually rather big as periodic numbers because periodic numbers who get smaller as you go off to the left, whereas real ones who get smaller as you go off to the right. So what can we do with these funny periodic numbers? Well, we can add and multiply periodic numbers. And we can add and multiply them using the usual rules. So if we've got a periodic number, say ending in 2, 1, so let's do 3 periodic numbers. So we're working base 3. And if you've got another periodic number, 1, 1, something or other, then we can just add them up using the usual rules for addition. So we add 1 and 1 and we get 2. Then we add 2 and 1, which is 3. So we get 0. And then we carry 1. And then we add up these numbers here. Maybe there's a 0 and a 1. So we add 0 and 1 and add the carry and we get 2. And we can go on like this. And it's sort of fairly obvious that we can go on forever and we get a perfectly good periodic number. And we can multiply them in much the same way. So if we wanted to multiply these, we would multiply 1 by 1 and get 1. Then we cross multiply 2 times 1 plus 1 times 2 is 3. So we get 0 and we carry 1. Then we have 0 times 1 plus 2 times 2 plus 1 times 1, which is 3. And we add the carry, which is 1 and we get 1 and so on. So we can just multiply them and add them in just the usual way. What about subtraction? Well, you might think we can't subtract periodic numbers. You remember for real numbers, if we want to subtract 2 from 1, we need to put a minus sign in front. And I never got round to putting minus signs in front of real numbers. However, we can also subtract p-addicts, p-addict numbers. So what about 0 minus 1? And let's work with 10 addict numbers rather than p-addict numbers. So what I want to do is I want to take the number 0 and I'm going to write this in base 10. And I want to subtract the number 1. Well, let's see what we get. Well, we have 0 minus 1 we can't do. So we have to borrow 1 from here and we get 10 minus 1, which is 9. Well, then we borrowed 1 from here. So we only get a 9 here. And then we have to borrow 1 from here. So we get another 9 and it goes on like this. And we just get 9s going all the way to the right. And this is actually equal to minus 1 as a 10-addict number. And you can kind of check this by adding 1 to this and 1 plus 9 is 0, carry 1, 1 plus 9 is 0, carry 1, 1 plus 9 is 0, carry 1 and so on. So we do actually have negative p-addict or 10-addict numbers. They just go off to the left infinitely often. So p-addict numbers we can do addition, subtraction and multiplication. We can't always do division, although we can do division by anything that's not divisible by p. So if we want to solve an ax is common to 1 mod p to the n, we can solve if a is not common to 0 mod p. And what this means is that a has an inverse in the p-addicts if p does not divide a. So we almost have division. I mean, if we're working with the p-addict numbers, we can't divide by p, but we can divide by anything not divisible by p. And we can ask questions like which numbers are squares? So over the reals, the numbers are squares if a is greater than or equal to 0, obviously. What about the two addicts? So we've got a two-addict number which, if we write it in base 2, it goes off infinitely far to the left. Well, we answered this before. If it's odd, and notice that for a two-addict number being odd makes sense because you just have to ask whether the last digit is odd or even, then we saw it's a square if and only if it's 1 mod 8. So that's if and only if it's something or other ending in 001. And more generally, if it's even, what we have to do, suppose it looks like something or other, and 1010000 something. So is this a square? Well, we can cross out pairs of zeros because that's just dividing by 4, which is a square. And then we look at what's left and the last three digits that we haven't yet crossed out have to be 1 mod 8. And this isn't 1 mod 8, so this is not a square. So we can tell where the numbers are squares in the two-addicts. And for the p-addicts, we had a very simple answer. So for the p-addicts, if we've got a number ending in A, this is a square. And let's take A, let's suppose the last digit A is not congruent to zero mod p. And then this is a square if and only if A is a square mod p, because we saw that if it's a square mod p, then we can lift it to a square modulo p squared and modulo p cubed and so on. And now we can see that if we compare the reals and say the two-addicts and the three-addicts, you can see that these are all quite different. For example, is minus 7 a square? Well, in the reals, it's obviously not. In the two-addicts, yes, because minus 7 is congruent to 1 mod 8. What about the three-addicts? Well, here we have minus 7 is congruent to 2 mod 3. So no, it's not a square because 2 isn't a square mod 3. So the two-addicts are definitely different from the reals and the two-addicts are definitely different from the three-addicts because they differ in whether minus 7 is a square or not. And of course, you can check with three-addicts are different from the reals by finding something that's a square in one but not in the other. So a sort of theme about periodic numbers is anything you can do for the reals has an analog for the p-addicts. So for instance, we've seen this with Newton's method. We can do Newton's method to find roots of equations over the real numbers. And we saw early on that we could use Newton's method to find roots of equations over the periodic numbers in just the same way. And then you can take everything you did in 1a calculus. You do differentiation or integration or you can define funny functions like exponential functions or logarithms or sine functions. And you can define analogs of all of these over the p-addicts. So there's a notion of differentiation and integration for periodic numbers. And we can define the periodic exponential function. And you can even do things like periodic gamma functions and periodic zeta functions if you're into that. So I'll just finish by giving an example of this. Over the reals, we can sometimes solve equations f of x equals x by iterating by iteration. So for instance, if you want to solve cosine x equals x, what you do is you pick some random number x0 and enter it into your pocket calculation, then you keep on hitting the cosine button. So you'd say x0 cosine x0 goes to cosine of cosine x0 and so on. And if you do this, you will see the number on your pocket calculator is converging to a root of cosine x equals x. And we can do this similar thing for the p-addicts. And in particular, you can try and solve the equation x to the p minus 1 is equal to 1 in the p-addict numbers. So what this means is we're trying to solve x to the p minus 1 is congruent to 1 mod p to the n for some very large number n. And you can write this, it's more or less the same as saying x to the p is congruent to x modulo p as long as x is not divisible by p, of course, or rather modulo p to the n. And now this is of the form fx equals x with f of x equals x to the p. So we can try and solve this by picking some random number, say 2, and then we take 2 to the p and then we might take 2 to the p to the p is 2 to the p to the p and this should converge to a solution of x to the p minus 1 equals 1 mod p to the n. So let's try it with p equals 5, we map 2 and then 2 goes to 2 to the 5 which is 32, which is congruent to us. So this is 2 mod 5, this is 7 mod 5 squared and then we square 7 which is, sorry, we don't square 7, we take 7 to the 5 which is congruent to 57 mod 5 cubed and so on. And these numbers 2, 7 and 57 are now sort of converging to a p-addict square, so not a p-addict square, a p-addict fourth root of 1. So, okay, that's I guess that's enough for solutions of equations modulo p to the n. So the next lecture I'll be talking about how do you solve the equation f of x is congruent to 0 modulo p, so we've shown how to reduce solutions mod p to the n to finding solutions mod p, so obviously we need to now discuss how to find solutions modulo p to the 1.