ap−1≡1 (mod p) .
In our case, we can use this to deduce the following:
212≡1 (mod 13) and 312≡1 (mod 13)
First, let’s check the power of 2:
212≡1 (mod 13), thus (212)6≡272≡16≡1 (mod 13).
We just barely got past the power of 70. If we could find a number n such that 2∗n≡1 (mod 13), we could reduce the exponent. Luckily, it’s not too hard to find one such number, after all, 2∗7=14 and 14≡1 (mod 13). So:
272≡1 (mod 13)→270∗2∗2≡1 (mod 13)
270∗2∗7∗2∗7≡7∗7 (mod\13)
270≡49≡10 (mod 13)
We can use a similar process for 3 to find that370≡9∗9≡81≡3 (mod 13)
Finally, 270+370≡10+3≡13≡0 (mod 13)