Calculate $40^{13} \pmod{85}.$ Express your answer as a non-negative integer that is less than 85.
Calculate \(40^{13} \pmod{85}\).
Express your answer as a non-negative integer that is less than \(85\).
\(\begin{array}{|rcll|} \hline 40^{3} \pmod{85} &\equiv& 80 \pmod{85} \\ &\equiv& 80-85 \pmod{85} \\ &\equiv& -5 \pmod{85} \\ \hline \end{array}\)
\(\begin{array}{|rcll|} \hline 40^{13} \pmod{85} &\equiv& 40^{3*4+1} \pmod{85} \\ &\equiv& 40^{3*4}*40 \pmod{85} \\ &\equiv& \left(40^3\right)^4*40 \pmod{85} \\ &\equiv& \left(-5\right)^4*40 \pmod{85} \\ &\equiv& 625*40 \pmod{85} \\ &\equiv& 25000 \pmod{85} \\ \mathbf{40^{13} \pmod{85}} &\equiv& \mathbf{ {\color{red}10} \pmod{85}} \\ \hline \end{array}\)