# Modular arithmetic

**modulomodcongruentmodularresidue classmoduluscongruencecongruence classintegers modulo ''nmodular addition**

In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value—the modulus (plural moduli).wikipedia

602 Related Articles

### Modulo operation

**modulomodmodulus**

; in this case, if the parentheses are omitted, this generally means that "mod" denotes the modulo operation, that is, that

In computing, the modulo operation finds the remainder after division of one number by another (called the modulus of the operation).

### Carl Friedrich Gauss

**GaussCarl GaussCarl Friedrich Gauß**

The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book Disquisitiones Arithmeticae, published in 1801.

He further advanced modular arithmetic, greatly simplifying manipulations in number theory.

### Congruence relation

**congruencecongruentcongruences**

According to the definition below, 12 is congruent not only to 12 itself, but also to 0, so the time called "12:00" could also be called "0:00", since 12 is congruent to 0 modulo 12. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers that is compatible with the operations on integers: addition, subtraction, and multiplication.

The prototypical example of a congruence relation is congruence modulo n on the set of integers.

### Equivalence relation

**equivalenceequivalentmodulo**

The congruence relation satisfies all the conditions of an equivalence relation: is an equivalence relation, and the equivalence class of the integer

### Fermat's little theorem

**Fermat's TheoremFermat little theoremFermat's "little theorem**

* Fermat's little theorem: If

In the notation of modular arithmetic, this is expressed as

### Primitive root modulo n

**primitive rootprimitive rootsPrimitive root modulo ''n**

* Primitive root modulo n: A number

In modular arithmetic, a branch of number theory, a number g is a primitive root modulo n if every number a coprime to n is congruent to a power of g modulo n.

### Modular multiplicative inverse

**multiplicative inversemodular inverseinverse mod**

The modular multiplicative inverse is defined by the following rules:

In the standard notation of modular arithmetic this congruence is written as

### Euclidean division

**Division theoremdividedivisible by two without remainder**

explicitly showing its relationship with Euclidean division.

Euclidean division, and algorithms to compute it, are fundamental for many questions concerning integers, such as the Euclidean algorithm for finding the greatest common divisor of two integers, and modular arithmetic, for which only remainders are considered.

### Wilson's theorem

**Gauss's generalization of Wilson's theorem**

.* Wilson's theorem:

That is (using the notations of modular arithmetic), the factorial satisfies

### Polynomial

**polynomial functionpolynomialsmultivariate polynomial**

, for any polynomial

. If the set of the coefficients does not contain the integers (for example if the coefficients are integers modulo some prime number

### Quotient group

**quotientfactor groupquotients**

in the quotient group, a cyclic group.

For example, the cyclic group of addition modulo n can be obtained from the group of integers under addition by identifying elements that differ by a multiple of n and defining a group structure that operates on each such class (known as a congruence class) as a single entity.

### Euler's criterion

**alternative expression for (''q''/''p'')Euler criterion**

. Euler's criterion asserts that, if

In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime.

### Equivalence class

**quotient setequivalence classesquotient**

is an equivalence relation, and the equivalence class of the integer

* Consider the modulo 2 equivalence relation on the set

### Cyclic group

**cyclicinfinite cyclic groupinfinite cyclic**

in the quotient group, a cyclic group.

Every finite cyclic group of order n is isomorphic to the additive group of Z/nZ, the integers modulo n.

### Commutative ring

**commutativecommutative rings rings**

In this way, becomes a commutative ring.

It is the basis of modular arithmetic.

### Isomorphism

**isomorphicisomorphouscanonical isomorphism**

, does not have zero elements; rather, it is isomorphic to \mathbb{Z}, since

Consider the group, the integers from 0 to 5 with addition modulo 6.

### Finite field

**Galois fieldfinite fieldsGF**

is a finite field if and only if

, may be constructed as the integers modulo p.

### Field (mathematics)

**fieldfieldsfield theory**

. Thus is a field when n\mathbb{Z} is a maximal ideal, that is, when

The simplest finite fields, with prime order, are most directly accessible using modular arithmetic.

### Quotient ring

**quotientfactor ringquotient algebra**

We use the notation because this is the quotient ring of \mathbb{Z} by the ideal n\mathbb{Z} containing all integers divisible by

### Coset

**cosetsleft cosetsleft coset**

is the group coset of

The coset (mZ + a, +) is the congruence class of a modulo m.

### Zero divisor

**zero divisorszero-divisorregular element**

elements, but this is not, which fails to be a field because it has zero-divisors.

### Addition

**sumaddadded**

Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers that is compatible with the operations on integers: addition, subtraction, and multiplication.

In modular arithmetic, the set of integers modulo 12 has twelve elements; it inherits an addition operation from the integers that is central to musical set theory.

### Abstract algebra

**algebraalgebraicmodern algebra**

In theoretical mathematics, modular arithmetic is one of the foundations of number theory, touching on almost every aspect of its study, and it is also used extensively in group theory, ring theory, knot theory, and abstract algebra.

Leonhard Euler considered algebraic operations on numbers modulo an integer, modular arithmetic, in his generalization of Fermat's little theorem.

### Modular exponentiation

**binary exponentiationexponentiationexponentiation modulo**

RSA and Diffie–Hellman use modular exponentiation.

Modular exponentiation is a type of exponentiation performed over a modulus.

### Characteristic (algebra)

**characteristicprime fieldcharacteristic zero**

, it is more useful to include (which, as mentioned before, is isomorphic to the ring \mathbb{Z} of integers), for example, when discussing the characteristic of a ring.

The ring Z/nZ of integers modulo n has characteristic n.