2020-09-15, 16:06
|
#13
|
"murat"
May 2020
turkey
7210 Posts
|
Quote:
Originally Posted by paulunderwood
Code:
Mod(10,107)^100000000000000000000000000000000000000000
Mod(34, 107)
##
*** last result computed in 0 ms
.
It actually works by left-right binary exponentiation modulo n
And since 107 is prime we can use Fermat's little theorem:
Code:
Mod(10,107)^(100000000000000000000000000000000000000000%106)
Mod(34, 107)
Or simething even "bigger":
Code:
Mod(10,107)^(100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000%106)
Mod(4, 107)
|
Thanks
|
|
|