Help


from Wikipedia
« »  
The theorem may be used to easily reduce large powers modulo n. For example, consider finding the ones place decimal digit of 7 < sup > 222 </ sup >, i. e. 7 < sup > 222 </ sup > ( mod 10 ).
Note that 7 and 10 are coprime, and φ ( 10 ) = 4.
So Euler's theorem yields 7 < sup > 4 </ sup > ≡ 1 ( mod 10 ), and we get 7 < sup > 222 </ sup > ≡ 7 < sup > 4 × 55 + 2 </ sup > ≡ ( 7 < sup > 4 </ sup >)< sup > 55 </ sup >× 7 < sup > 2 </ sup > ≡ 1 < sup > 55 </ sup >× 7 < sup > 2 </ sup > ≡ 49 ≡ 9 ( mod 10 ).

2.021 seconds.