What is the remainder when $5^{137}$ is divided by 8?
\(\begin{array}{|rcll|} \hline \text{Because the } gcd(5,8) = 1 \\ 5^{\varphi(8)} \equiv 1 \pmod 8 \\ \hline \end{array} \)
\(\varphi(n) \text{ is the Euler's totient function}\)
\(\begin{array}{|rcll|} \hline 8 &=& 2^3 \\ \varphi(8) &=& 8 \cdot \left( 1-\frac12 \right) \\ \varphi(8) &=& 4 \\ 5^{4} &\equiv& 1 \pmod 8 \\ \hline \end{array}\)
\(\begin{array}{|rcll|} \hline && 5^{137} \pmod 8 \\ &\equiv& 5^{4\cdot 34 + 1 }\pmod 8 \\ &\equiv& 5^{4\cdot 34}\cdot 5 \pmod 8 \\ &\equiv& (5^{4})^{34}\cdot 5 \pmod 8 \qquad | \qquad 5^{4} \equiv 1 \pmod 8 \\ &\equiv& 1^{34}\cdot 5 \pmod 8 \\ &\equiv& 1 \cdot 5 \pmod 8 \\ &\equiv& 5 \pmod 8 \\ \hline \end{array}\)
The remainder is 5