Powering Modulo n
Notes:
- Answers are always given as Euclidean remainders between 0 and n-1
inclusive.
- Entering j=1 will just give the remainder when a is
divided by n.
- Negative exponents are allowed provided a and n are
relatively prime.
- Entering j=-1 will compute the multiplicative inverse of
a modulo n.
- Inputs can range up to 252.