5^137 =
573971 8509874450 7225035963 7315549647 3723952913 9262086011 1695169081 2584274681 2850236892 7001953125 / 8 =71746 4813734306 3403129495 4664443705 9215494114 2407760751 3961896135 1573034335 1606279611 5875244140.625
Since .625 x 8=5 Remainder.
5^1 mod 8 = 5
5^2 mod 8 = 1
5^3 mod 8 = 5
therefore 5^(2n+1) mod 8 = 5
therefore 5^137 mod 8 = 5.
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