![]() | ||
In modular arithmetic the set of congruence classes relatively prime to the modulus number, say n, form a group under multiplication called the multiplicative group of integers modulo n. It is also called the group of primitive residue classes modulo n. In the theory of rings, a branch of abstract algebra, it is described as the group of units of the ring of integers modulo n. (Units refers to elements with a multiplicative inverse.)
Contents
- Group axioms
- Notation
- n 1
- Powers of 2
- Powers of odd primes
- General composite numbers
- Subgroup of false witnesses
- Order
- Exponent
- Generators
- Examples
- References
This group is fundamental in number theory. It has found applications in cryptography, integer factorization, and primality testing. For example, by finding the order of this group, one can determine whether n is prime: n is prime if and only if the order is n − 1.
Group axioms
It is a straightforward derivation exercise to show that, under multiplication, the set of congruence classes modulo n that are relatively prime to n satisfy the axioms for an abelian group.
Because a ≡ b (mod n) implies that gcd(a, n) = gcd(b, n), the notion of congruence classes modulo n that are relatively prime to n is well-defined.
Since gcd(a, n) = 1 and gcd(b, n) = 1 implies gcd(ab, n) = 1 the set of classes relatively prime to n is closed under multiplication.
The natural mapping from the integers to the congruence classes modulo n that takes an integer to its congruence class modulo n respects products. This implies that the class containing 1 is the unique multiplicative identity, and also the associative and commutative laws hold. In fact it is a ring homomorphism.
Given a, gcd(a, n) = 1, finding x satisfying ax ≡ 1 (mod n) is the same as solving ax + ny = 1, which can be done by Bézout's lemma. The x found will have the property that gcd(x, n) = 1.
Notation
The (quotient) ring of integers modulo n is denoted
The notation
n = 1
Modulo 1 any two integers are congruent, i.e. there is only one congruence class. Every integer is relatively prime to 1. Therefore, the single congruence class modulo 1 is relatively prime to the modulus, so
Because of its trivial nature, the case of congruences modulo 1 is generally ignored. For example, the theorem "
Powers of 2
Modulo 2 there is only one relatively prime congruence class, 1, so
Modulo 4 there are two relatively prime congruence classes, 1 and 3, so
Modulo 8 there are four relatively prime classes, 1, 3, 5 and 7. The square of each of these is 1, so
Modulo 16 there are eight relatively prime classes 1, 3, 5, 7, 9, 11, 13 and 15.
The pattern shown by 8 and 16 holds for higher powers 2k, k > 2:
Powers of odd primes
For powers of odd primes and their multiplying by 2: pk or 2*pk the group is cyclic:
General composite numbers
The Chinese remainder theorem says that if
Similarly, the group of units
Subgroup of false witnesses
If n is composite, there exists a subgroup of the multiplicative group, called the "group of false witnesses", in which the elements, when raised to the power n − 1, are congruent to 1 modulo n (since the residue 1, to any power, is congruent to 1 modulo n, the set of such elements is nonempty). One could say, because of Fermat's Little Theorem, that such residues are "false positives" or "false witnesses" for the primality of n. 2 is the residue most often used in this basic primality check, hence 341 = 11 × 31 is famous since 2340 is congruent to 1 modulo 341, and 341 is the smallest such composite number (with respect to 2). For 341, the false witnesses subgroup contains 100 residues and so is of index 3 inside the 300 element multiplicative group mod 341.
Examples
n = 9
The smallest example with a nontrivial subgroup of false witnesses is 9 = 3 × 3. There are 6 residues relatively prime to 9: 1, 2, 4, 5, 7, 8. Since 8 is congruent to −1 modulo 9, it follows that 88 is congruent to 1 modulo 9. So 1 and 8 are false positives for the "primality" of 9 (since 9 is not actually prime). These are in fact the only ones, so the subgroup {1,8} is the subgroup of false witnesses. The same argument shows that n − 1 is a "false witness" for any odd composite n.
n = 91
For n = 91, there are
n = 561
561 is a Carmichael number, thus n560 is congruent to 1 modulo 561 for any number n coprime to 561. Thus the subgroup of false witnesses is in this case not proper; it is the entire group of multiplicative units modulo 561, which consists of 320 residues.
Order
The order of the group is given by Euler's totient function:
Exponent
The exponent is given by the Carmichael function
Generators
The group
Since all the
In the general case there is one generator for each cyclic direct factor.
Examples
This table shows the cyclic decomposition of
For example, we take n = 20.
The powers of 19 are {±1} and the powers of 3 are {3, 9, 7, 1}. The latter and their negatives modulo 20, {17, 11, 13, 19} are all the numbers less than 20 and coprime to it. That the order of 19 is 2 and the order of 3 is 4 implies that the fourth power of every member of
Smallest primitive root mod n are (0 if no root exists)
0, 1, 2, 3, 2, 5, 3, 0, 2, 3, 2, 0, 2, 3, 0, 0, 3, 5, 2, 0, 0, 7, 5, 0, 2, 7, 2, 0, 2, 0, 3, 0, 0, 3, 0, 0, 2, 3, 0, 0, 6, 0, 3, 0, 0, 5, 5, 0, 3, 3, 0, 0, 2, 5, 0, 0, 0, 3, 2, 0, 2, 3, 0, 0, 0, 0, 2, 0, 0, 0, 7, 0, 5, 5, 0, 0, 0, 0, 3, 0, 2, 7, 2, 0, 0, 3, 0, 0, 3, 0, ... (sequence A046145 in the OEIS)Numbers of the elements in a minimal generating set of mod n are
0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 3, 1, 2, 1, 2, 2, 1, 1, 3, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 3, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3, 1, 1, 2, 2, 2, 2, 1, 3, 1, 1, 1, 3, 2, 1, 2, 3, 1, 2, ... (sequence A046072 in the OEIS)