Saturday, August 27, 2016

elementary number theory - Calculating 29999 mod 100 using Fermats little Theorem



By a modified version of the Fermat's little theorem we obtain that aϕ(n)1 mod n whenever (a,n)=1. But my professor accidentally gave this question to calculate 29999 mod 100. So everyone in the class calculated it using the theorem since they forgot to check that (a,n)=1. But to my surprise everyone got 88 as the answer which is actually the correct answer.



So I first saw what happens in the case of mod 10. Here 246 mod 10. But magically enough this number multiplies with powers of 2 as if it were identity i.e.



262(mod10)




464(mod10)



666(mod10)



868(mod10)



After seeing this I checked what happens in the case of 100. Similar thing happens even here instead 24076(mod100). Now 76 acts like 6 just that 7622 but otherwise 764=4 and 768=8 and so on. Can anyone explain as to why it is happening here and does it happen in other cases as well.


Answer



What's going on here is a direct result of the prime factorizations of 10=25 and 100=2252. Try writing it like this:

262(5+1)25+210+2(mod10)4645+410+4(mod10)
and so on. Since 6=5+1, multiplying by an even number will "cancel out" the 5, and you'll just be left with the 1, acting like an identity. Same thing is going on with 76=75+1=325+1. To cancel out the 325, you need an even number that's divisible by 4 (425=100). If you test 766(mod100), you should find that the result is nonzero.



This sort of thing will happen whenever you're calculating mod n=mi=1peii (here mi=1peii is the prime factorization of n) and you look at multiplication by a number k of the form 1+(anything)(product of some of the pi's). Whenever you multiply k by any number whose factorization includes the pi's not appearing in the "product of some of the pi's" (counted with multiplicity), you'll cancel off the second term of k and be left essentially multiplying by 1. As an easy example, look mod 6. Multiplication by 3 acts like the identity for 3 and 0 because 3=1+2 and 6=23.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...