On Khan Academy I have found this property:
$$ A^B \; \text{mod} \; C = ( (A \; \text{mod} \; C)^B ) \; \text{mod} \; C $$
with (of course) $A,B,C \in \mathbb{Z}$.
I was wondering how you can prove it.
I thought to write: $ A = C \cdot m + r $ with $ 0 \le r < C $
So that: $ A \; \text{mod} \; C = r $
And
$ A^B = (C \cdot m + r)^B = \sum\limits_{k=0}^B \binom{B}{k} (C \cdot m)^k r^{B-k}$
But now?
Notice that in your binomial formula all terms in $(Cm)^k\equiv 0\pmod C$ except for $k=0$, so you are left with $r^B$.
Since $r=A \pmod C$ you have proved the statement.