While performing some arithmetic operations, i am stuck at one point.I want to know is it possible to write ($a^b)\%p$ as ($a^{(b\%p)})\%p$?
Modulo Power Arithmetic
$\begingroup$
modular-arithmetic