How to find the reminder when $982^{40167}$ is divided by 15? I probably have to use Euler's function but I'm not sure how.
$$\phi(15) = 8$$ which means $$a^8 \equiv 1\pmod {15}$$

$$ 40167 = 7 + 5020 \times 8$$

And $$982 = 65 \times 15 + 7$$

$$982^{40167} \equiv 7^{7} \equiv 13 \pmod {15}$$

EDIT: one may figure out how to calculate $7^{7}$

The story is really simple:

$$7^2 \equiv 49 \equiv 4 \pmod{15} $$

Therefore, 

$$7^4 \equiv 4\times4 \equiv 1 \pmod{15} $$

$$7^7 \equiv 7^4 7^2 7 \equiv 1\times 4 \times 7 \equiv 13 \pmod {15}$$
You can do it like that:
$982^{40167}\equiv7^{40167}\equiv343^{13389}\equiv13^{13389}\equiv2197^{4463}\equiv7^{4463}\equiv7*49^{2231}\equiv13*1^{1115}\equiv13(mod  15)$