<s>[INST] Fermats Little Theorem: How $(3^7)^{17}$ will leave the same remainder when divided by $17$ as $3^7$? As it is used in this explanation, how and why $(3^7)^{17}$ will leave the same remainder when divided by $17$ as $3^7$?
Thanks!
 [/INST] The question referred to is

Find the remainder when $54^{124}$ is divided by $17$

Step 1: Reduce the base according to the modulus
We can see that $54 \equiv 3 \bmod 17$, so  $54^{124} \equiv 3^{124} \bmod 17$.
Step 2: Reduce the exponent according to the order of the base
We know that, since $17$ is prime, $a^{17} \equiv a$. Specifically, when $a$ is coprime to $17$, $a^{16} \equiv 1 \bmod 17$. So we can cast out $16$s from the exponent and get $54^{124} \equiv 3^{12} \bmod 17$.
Step 3: Calculate the result
The final step of calculating $ 3^{12} \bmod 17$ could (for example) be completed by considering 
$$3^4 = 81 \equiv -4 \bmod 17, \\
\text{ then }\: 54^{124} \equiv 3^{12} \equiv (-4)^3 \equiv 16\cdot -4 \equiv-1\cdot -4 \equiv 4 \bmod 17 
$$
Although a straightforward one-by-one exponentiation is easy enough here:
$$\begin{array}{c|c}
n & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\ \hline
3^n \bmod 17 & 3 & 9 & 10 & 13 & 5 & 15 & 11 & 16 & 14 & 8 & 7 & 4\\
\end{array}$$
</s>