Calculate 7 82 mod 40
Maybe just start calculating. Note that . So . We got lucky.
It follows that . Thus .
In general, repeated squaring, and reduction with respect to our modulus (in this case ) gets us to high powers fairly quickly.
A more elaborate way is to use Euler's Theorem. If is relatively prime to , then
Here is the Euler -function. We have , so taking we have . It follows that . So . But .
Still another way is to factor as . We then work separately modulo and modulo .
First modulo : We have , so .
Next modulo : We have , so , and therefore . (We could also get this directly by using Fermat's Theorem.) It follows that , and therefore .
Now we are looking for the numbers that are congruent to modulo and to modulo . For bigger numbers, we can use the Chinese Remainder Theorem. But finding a number congruent to modulo and to modulo can also be done without much machinery.
In general, the technique to use depends very much on the modulus . If it is huge, and we do not know its prime factorization, then the Binary Method of exponentiation is quite efficient.
Reference Link:
http://math.stackexchange.com/questions/165670/congruence-modulo-with-large-exponents
Reference Link:
http://math.stackexchange.com/questions/165670/congruence-modulo-with-large-exponents
No comments:
Post a Comment