Original Modular Arithmetic Calculator

This is the original Modular Arithmetic Calculator, which is performs a single set of calculations and displays the results.

If you want to do repeated operations, try the new Modular Arithmetic Calculator, which enables you to store the last result and then recall it at a later time to either the a or b input box.

In modular (or "clock") arithmetic, all integers are reduced to their remainder after dividing by a fixed integer, called the modulus. For example, suppose the modulus is 7. To reduce 16 modulo 7, divide 16 by 7. The result is the remainder, 2.

To use the Modular Arithmetic Calculator, enter a non-zero integer for the modulus m, and integers a and b below. To calculate an, enter a positive integer for the exponent n. Then click Calculate.

Modulus m:
a: b:
Exponent n:

Results (modulo m)

a + b =
a - b =
a * b =
a / b =
an =
a =

Note: Square roots are only calculated when the modulus m is prime.

Division modulo m

In modular arithmetic, you can only divide by numbers that have no common factors with the modulus (other than 1). For example, you can divide by 3 modulo 17 because 3 and 17 have no common factors. If the modulus is a prime number, you can divide by any number that is not a multiple of the modulus - in other words, by any number that is not equal to 0 modulo that prime. As a result, arithmetic modulo a prime number has the same basic properties as ordinary arithmetic in the real numbers.

Notes on modular arithmetic

    Send comments.

   Paul Trow's math software.

Copyright 2009 by Paul Trow