Calculate: $27^{162} \pmod {41}$
So we need to calculate x which is a remainder of $$\frac{27^{162}}{41}$$
$27 = 3^3$ so we can write such equation: $$3^{486} = 41k + x$$ or $$3^{3 \times 162} = 41k + x$$ where x is a reminder.
But what do I do next to calculate this without using calculator(or using simple one)?
By Fermat's Little theorem, $$27^{40}\equiv1\pmod{41}$$ So, $$(27^{40})^4\equiv1^4\equiv1\pmod{41}$$ Hence, $$27^{162}=(27^{40})^4\times 27^2\equiv 27^2\pmod{41}$$