Assuming basic knowledge of modulus arithmetic, is there a way, a trick or formulas that allow you to solve modulus question with very large numbers without using calculator? For example,
$$76^7 \mod 187=32$$ $$7^{23} \mod 143=2$$
This question ties into RSA Encryption where I'm trying to figure out how to solve these questions. So if I have $31^6 \mod 189$, I can simply use Wolfram Alpha but how can I work out that $31^6 \mod 189$?
$31^2=961$ and $5\times 189=945$ so that $31^6\equiv 16^3$ and if you know your powers of $2$ this is efficiently sorted.