Group Theory Order Calculator
Element Order · Subgroup Order · Lagrange's Theorem
Compute the order of elements in Zₙ (cyclic), Sₙ (permutation), and Zₙ* (multiplicative) groups. Generate subgroups and verify Lagrange's theorem.
Group Type
Quick Examples
Group Zₙ = {0, 1, 2, ..., n−1} under addition mod n. Element a ∈ {0, ..., n−1}. Identity = 0.
Enter disjoint cycles using spaces between elements, e.g. (1 2 3)(4 5). Fixed points are inferred automatically. Single cycles like (1 2 3 4) are valid too.
Group Zₙ* = units mod n (elements coprime to n). Requires gcd(a, n) = 1. Identity = 1.
Computation
Generated Subgroup ❬a❭
Powers / Multiples Table
What Is Group Theory?
Group theory is a branch of abstract algebra that studies the algebraic structure called a group — a set equipped with a binary operation satisfying four axioms: closure, associativity, the existence of an identity element, and the existence of inverses. Developed in the 19th century by mathematicians including Galois, Cauchy, and Lagrange, group theory has become a unifying framework across mathematics, physics, chemistry, and computer science.
Groups appear naturally whenever we study symmetry. The symmetries of a regular polygon, the set of permutations of n objects, the integers under addition, and the non-zero residues modulo a prime under multiplication are all examples of groups.
Order of an Element
Given a group G with identity element e, the order of an element a, written ord(a) or |a|, is the smallest positive integer k such that ak = e. If no such k exists, a has infinite order. For finite groups, every element has finite order, and ord(a) always divides the order of G by Lagrange's theorem.
Intuitively, the order measures how many times you must "apply" the element to itself before returning to the starting point (the identity).
Cyclic Groups Zₙ
The cyclic group Zₙ (integers mod n under addition) is the simplest group of order n. Its elements are {0, 1, 2, ..., n−1} and the operation is addition modulo n. The identity is 0.
For element a in Zₙ, the order is given by the formula:
| Formula | Where |
|---|---|
| ord(a) = n / gcd(a, n) | gcd = greatest common divisor |
| a is a generator ⇔ gcd(a, n) = 1 | generates all of Zₙ |
| ❬a❭ = {0, a, 2a, ..., (k−1)a} mod n | k = ord(a) |
For example, in Zₙ₁₂: ord(3) = 12/gcd(3,12) = 12/3 = 4, and the subgroup ❬3❭ = {0, 3, 6, 9}. Meanwhile, ord(5) = 12/gcd(5,12) = 12/1 = 12, so 5 generates all of Z₁₂.
Lagrange's Theorem
Lagrange's theorem is one of the most fundamental results in group theory. It states: if G is a finite group and H is a subgroup of G, then |H| divides |G|. The quotient |G|/|H| = [G:H] is called the index of H in G.
As an immediate corollary, for any element a in a finite group G, ord(a) divides |G|. This is because the cyclic subgroup ❬a❭ generated by a has order exactly ord(a), and by Lagrange's theorem |❬a❭| divides |G|.
Lagrange's theorem also implies that groups of prime order are always cyclic, and every non-identity element is a generator.
Permutation Groups Sₙ
The symmetric group Sₙ consists of all permutations (bijections) of n elements, with function composition as the operation. |Sₙ| = n!. Every permutation can be written uniquely (up to order) as a product of disjoint cycles.
The order of a permutation equals the LCM of its cycle lengths. For instance, (1 2 3)(4 5) has cycle lengths 3 and 2, so its order is LCM(3, 2) = 6. This follows because each cycle individually returns to the identity after exactly its length number of applications, and disjoint cycles commute.
The cycle type of a permutation (its list of cycle lengths in non-increasing order) completely determines its order.
Multiplicative Groups Zₙ*
The multiplicative group Zₙ* consists of all integers from 1 to n−1 that are coprime to n, under multiplication mod n. Its order is Euler's totient φ(n).
A primitive root modulo n is an element a whose order equals φ(n), meaning it generates all of Zₙ*. Primitive roots exist if and only if n = 1, 2, 4, pk, or 2pk for odd primes p. For example, 3 is a primitive root mod 7 since 3 has order 6 = φ(7), generating {1, 2, 3, 4, 5, 6}.
Applications in Cryptography
Group theory underpins much of modern cryptography. The discrete logarithm problem — finding k such that gk ≡ h (mod p) — is believed to be computationally hard in certain groups, which forms the security basis of:
- Diffie-Hellman key exchange: Uses a generator g of Zₙ* to share a secret exponent.
- ElGamal encryption: Based on the same discrete log problem in Zₙ*.
- Elliptic Curve Cryptography (ECC): Operates in the group of points on an elliptic curve over a finite field — substantially more efficient per bit of security.
- RSA: Although not directly a discrete log problem, RSA's security relies on the structure of Zₙ* and the difficulty of factoring n = pq to compute φ(n).
Reference Table: Common Group Orders
| Group | Element | ord(element) | Group Order | Generator? |
|---|---|---|---|---|
| Z₁₂ | 3 | 4 | 12 | No |
| Z₁₂ | 5 | 12 | 12 | Yes |
| Z₆ | 2 | 3 | 6 | No |
| S₅ | (1 2 3)(4 5) | 6 | 120 | No |
| S₄ | (1 2 3 4) | 4 | 24 | No |
| Z₇* | 3 | 6 | 6 | Yes (primitive root) |
| Z₈* | 2 | 2 | 4 (φ(8)=4) | No |