Modular exponentiation: Difference between revisions

Content deleted Content added
m Added comment
m added whitespace.
Line 1:
{{task}}
Find the last &nbsp; '''40''' &nbsp; decimal digits of &nbsp; <math>a^b</math>, &nbsp; where
 
::* &nbsp; <math>a = 2988348162058574136915891421498819466320163312926952423791023078876139</math>
::* &nbsp; <math>b = 2351399303373464486466122544523690094744975233415544072992656881240319</math>
 
<br>
A computer is too slow to find the entire value of <math>a^b</math>.
 
Instead,A thecomputer programis musttoo useslow ato fastfind algorithmthe forentire [[wp:Modularvalue exponentiation|modularof exponentiation]]:&nbsp; <math>a^b \mod m</math>.
 
TheInstead, algorithmthe program must workuse fora anyfast integersalgorithm <math>a,for b,[[wp:Modular m</math>exponentiation|modular <br>whereexponentiation]]: &nbsp; <math>a^b \gemod 0</math> and <math>m > 0</math>.
 
The algorithm must work for any integers &nbsp; <math>a, b, m</math>, &nbsp; &nbsp; where &nbsp; <math>b \ge 0</math> &nbsp; and &nbsp; <math>m > 0</math>.
<br><br>