# Modulo Calculator

 Modulo Calculator a ≡ ? (mod b) ≡ ( mod )

Modular arithmetic is based on division with remainder. The expression "a ≡ c (mod b)" is read as "a is equivalent to c, mod b." It means that when you divide both a and c by b, their remainders are the same. For example

10 ≡ 101 (mod 7)
10 ≡ 3 (mod 7)
101 ≡ 3 (mod 7)

are all true because 3, 10, and 101 give a remainder of 3 when you divide them by 7. Similarly,

-4 ≡ 3 (mod 7)
-11 ≡ 3 (mod 7)
-18 ≡ 3 (mod 7)

The fundamental solution of a modular equation is a number between 0 and b-1; in the examples above, it is 3.

Modular arithmetic and equivalence is used frequently in number theory and mathematical proofs. The calculator on the left will compute the fundamental modulo equivalence for a given number and modulo base.

### Example of Modular Arithmetic in Proofs

Prove that for every integer n the following is true:

n² ≡ 0 (mod 4) if n is even
n² ≡ 1 (mod 4) if n is odd

First consider the case when n is an even number. Every even integer can be represented by 2k, where k is an integer. If n = 2k, then n² = 4k². Since 4k² is a multiple of 4, when you divide it by 4 you get a remainder of 0. Thus, n² ≡ 0 (mod 4) if n is even.

If n is odd, then it can be represented as 2k + 1. (Every odd integer is 1 more than an even integer.) If n = 2k + 1, then n² = 4k² + 4k + 1. Notice that

4k² + 4k + 1 = 4(k² + k) + 1,

which 1 plus a multiple of 4. Dividing this number by 4 will return a remainder of 1. Thus, n² ≡ 1 (mod 4) if n is odd.