Do modular rules apply for repeated exponents

25 Views Asked by At

The exponent rule for modular arithmetic states that $$a^b \equiv (a \;mod \; m)^b \;(mod\;m)$$

Does this rule apply for repeated exponents which are computed from top to bottom? For example, is this true? $$a^{b^c} \equiv (a\;mod\;m)^{(b\;mod\;m)^c}\;(mod\;m)$$