What is the remainder when $5^{137}$ is divided by 8?
Because the gcd(5,8)=15φ(8)≡1(mod8)
φ(n) is the Euler's totient function
8=23φ(8)=8⋅(1−12)φ(8)=454≡1(mod8)
5137(mod8)≡54⋅34+1(mod8)≡54⋅34⋅5(mod8)≡(54)34⋅5(mod8)|54≡1(mod8)≡134⋅5(mod8)≡1⋅5(mod8)≡5(mod8)
The remainder is 5
