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!
 A: $$n^{17} \equiv n\pmod {17} $$
This is just what the little Fermat theorem says, right (when you take $p=17$)?
So this is true for all n. So it is also true for $n=3^7$.      
A: 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}$$
A: Because $a^p \equiv a \pmod p$ (where $p$ is a prime) by Fermat's little theorem. (Think $3^7$ as $a$.)
A: Fermat's little theorem says  that 
$$a^p = a \mod p$$
for prime p.
Here $a$ is $3^7$ and prime $p$ is $17$. If you need to prove FLT, there is a wikipedia article on just that subject.
