## Computing a^{n} mod m

This web form computes a^{n} mod m using a perl script.
The perl script simply implements the algorithm from class in which
if n is even we replace a by a^{2} mod m and n by n/2,
or, if n is odd, we replace a by a^{2} mod m and n by (n-1)/2,
but in addition we have an extra factor of a to keep track of.