Mod of numbers with large exponents [modular order reduction] I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:

*

*$13^{100} \bmod 7$

*$7^{100} \bmod 13$
I've also heard of the Congruence Power Rule
$$a \equiv b \,\Rightarrow\, a^k \equiv b^k \pmod n $$
But I don't see how exactly to use that here, because from $13^1 \bmod 7\,$ I get $6$, and $13^2 \bmod 7$ is $1$. I'm unclear as to which one to raise to the $k$'th power here (I'm assuming $k = 100$?)
Any hints or pointers in the right direction would be great.

Quick answer:
$13 = 2\cdot 7-1$ so $13\equiv-1\mod 7$ and therefore $13^{100} \equiv (-1)^{100} \mod 7$
Other one is fairly quick:
\begin{eqnarray}
\phi(13) = 12\\ 
\gcd(7,13)=1\\
7^{100}\equiv7^{4} \mod13\\
7\rightarrow10\rightarrow5\rightarrow9
\end{eqnarray}
Probably a nicer way to do that.
