<s>[INST] Modular Algebra with Powers? Is it possible to calculate by modular algebra rules (with no calculators) numbers with powers $\textrm{mod}\ n$? Something like: $7^{127} \textrm{mod}\ 11$. If so, how it can be done? 
Any explanation will be apriciated! 
 [/INST] First,
$$7^{127} \equiv 8 \cdot 7 \cdot 7^{127} \equiv 8 \cdot 7^{128} \equiv 8 \cdot 7^{2^7} \pmod{11}$$
Now, step by step:
$$7^2 \equiv 49 \equiv 5 \pmod{11}$$
$$5^2 \equiv 25 \equiv 3 \pmod{11}$$
$$3^2 \equiv 9 \equiv -2 \pmod{11}$$
$$(-2)^2 \equiv 4 \pmod{11}$$
$$4^2 \equiv 16 \equiv 5 \pmod{11}$$
You have still two squares to compute, but you can find them already computed above:
$$5^2 \equiv 25 \equiv 3 \pmod{11}$$
$$3^2 \equiv 9 \equiv -2 \pmod{11}$$
Now, we have squared $7$ times, so we have computed:
$$\left(\left(\left(\left(\left(\left(7^2\right)^2\right)^2\right)^2\right)^2\right)^2\right)^2 \equiv 7^{2^7} \equiv -2 \pmod{11}$$
And finally
$$7^{127} \equiv 8 \cdot 7^{128} \equiv 8 \cdot -2 \equiv -16 \equiv 6 \pmod{11}$$
</s>