Modular Arithmetic

​
modulus
5
restriction
none
nonzero
units only
operation
plus
times
power
sum of squares
This visually illustrates various properties of modular arithmetic by creating an "operation table" modulo
n
, where 0 is represented by black, 1 by white, and other values by intermediate colors. The allowed numbers can be restricted to be nonzero or the units modulo
n
, and the operations are modular addition, subtraction, powers, and sums of squares.

Details

This visual display of modular arithmetic can be used to illustrate different principles of modular arithmetic (such as the existence of additive or multiplicative inverses modulo
n
). Because 0 is always represented by black and 1 by white, it makes these values easy to spot in the table. For example, to determine which numbers have multiplicative inverses mod 12, you simply need to move the modulus slider to 12, the operation to times, and then determine which rows of the table have the white "1" square. By using this Demonstration, you can see a wide range of values and different operations for modular arithmetic, which is quite useful for those beginning to study algebra/number theory.

External Links

Modular Arithmetic (Wolfram MathWorld)

Permanent Citation

Christopher Moretti
​
​"Modular Arithmetic"​
​http://demonstrations.wolfram.com/ModularArithmetic/​
​Wolfram Demonstrations Project​
​Published: September 27, 2007