TITLE: What is the shortest way to compute the last 3 digits of $17^{256}$?
QUESTION [9 upvotes]: What is the shortest way to compute the last 3 digits of $17^{256}$ ?
My solution:
\begin{align}
17^{256} &=289^{128} \\
&=(290 - 1)^{128}\\
&=\binom{128}{0}290^{128} -  ... +\binom{128}{126}290^2 - \binom{128}{127}290 + \binom{128}{128}
\end{align}
Computed the last 3 terms whose last 3 digits gave the last 3 digits of $17^{256}$.
Is there any shorter method to do this(which requires much less computation) ?

REPLY [8 votes]: Your way seems to be the fastest for me
$$\binom{128}{128}=1\equiv1\mod{1000}$$
$$\binom{128}{127}=128\equiv28\pmod{100}$$
$$\implies  \binom{128}{127}290\equiv 28\cdot290\pmod{1000}\equiv120$$
$$\binom{128}{126}=\frac{128\cdot127}2\equiv8\pmod{10}$$
$$\implies \binom{128}{126}290^2\equiv 290^2\cdot8\pmod{1000}\equiv800 $$
Using $a\equiv b\pmod m\implies a\cdot c\equiv b\cdot c\pmod {c\cdot m}$ where $a,b,c,m$ are integers