Computing an mod m
This web form computes an 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 a2 mod m and n by n/2,
or, if n is odd, we replace a by a2 mod m and n by (n-1)/2,
but in addition we have an extra factor of a to keep track of.