Skip to content

Cyclic Groups and Generators

In this lesson you’ll learn what makes a group cyclic, how to find the order of an element, which elements generate a cyclic group, and the classification theorem that says there is essentially only one cyclic group of each size.

The order of an element aa, written a|a|, is the smallest positive integer nn with

an=ea^n = e

If no such nn exists, aa has infinite order.

In Z12\mathbb{Z}_{12}, the element 33 has order 4, because 3+3+3+3=1203 + 3 + 3 + 3 = 12 \equiv 0 and no smaller count reaches 00. In (Z,+)(\mathbb{Z}, +), every nonzero element has infinite order, since no number of copies of 55 ever sums to 00.

Note the collision flagged in an earlier lesson: G|G| is how many elements the group has, while a|a| is a property of one element. Same notation, different meanings, distinguished only by whether the thing inside is a group or an element.

GG is cyclic if there is a single element aa with

G=aG = \langle a \rangle

Such an aa is a generator. One element, applied over and over, produces the whole group.

Every cyclic group is abelian, and the proof is one line: aiaj=ai+j=ajaia^i a^j = a^{i+j} = a^j a^i, since integer addition commutes. The converse is false - the Klein four-group is abelian and not cyclic - so “cyclic” is strictly stronger.

In Zn\mathbb{Z}_n, the element kk generates the whole group exactly when

gcd(k,n)=1\gcd(k, n) = 1

More generally, k\langle k \rangle has order

k=ngcd(k,n)|k| = \frac{n}{\gcd(k, n)}

Here’s why. Repeatedly adding kk produces the multiples of kk mod nn, and you first return to 00 at the least common multiple of kk and nn, which is kngcd(k,n)\frac{kn}{\gcd(k,n)}. Dividing by kk gives the number of steps, ngcd(k,n)\frac{n}{\gcd(k,n)}. When the gcd is 1 that count is nn, so you visit everything.

So Z12\mathbb{Z}_{12} has generators 1,5,7,111, 5, 7, 11: four of them, which is φ(12)\varphi(12). In general a cyclic group of order nn has exactly φ(n)\varphi(n) generators.

A prime-order group is the extreme case: Z7\mathbb{Z}_7 has φ(7)=6\varphi(7) = 6 generators, meaning every element except the identity generates the whole thing.

Cyclic groups have the tidiest subgroup structure in all of group theory.

Every subgroup of a cyclic group is cyclic. And if G=n|G| = n, then GG has exactly one subgroup of order dd for each divisor dd of nn, and no others.

That’s why the lattice of Z12\mathbb{Z}_{12} from the previous lesson had exactly six nodes, matching the six divisors of 12. The subgroup of order dd is generated by n/dn/d.

This is a strong property, and most groups don’t have it. D4D_4 has order 8 but five different subgroups of order 2.

Here is the first classification theorem in the section, and it is remarkably clean.

  • Every infinite cyclic group is isomorphic to (Z,+)(\mathbb{Z}, +).
  • Every finite cyclic group of order nn is isomorphic to (Zn,+)(\mathbb{Z}_n, +).

So up to renaming, there is exactly one cyclic group of each size. When you understand Zn\mathbb{Z}_n, you understand every cyclic group of order nn that anyone will ever show you.

The reason is easy to see: if G=aG = \langle a \rangle has order nn, matching akka^k \leftrightarrow k turns GG‘s multiplication into addition mod nn, and that dictionary is a perfect translation.

Every group of prime order is cyclic. Take G=p|G| = p prime and any aea \ne e. The subgroup a\langle a \rangle has order dividing pp (Lagrange, coming shortly), so its order is 11 or pp. It isn’t 1 because aea \ne e. So a=G\langle a \rangle = G.

That settles the structure of infinitely many groups in three lines. There is exactly one group of order 7, one of order 11, one of order 101.

Example 1: Find the order of each element of Z10\mathbb{Z}_{10}.

Solution. Use k=10gcd(k,10)|k| = \frac{10}{\gcd(k,10)}.

kkgcd(k,10)\gcd(k,10)k\|k\|
0101
1110
225
3110
425
552
625
7110
825
9110

Generators are 1,3,7,91, 3, 7, 9, and φ(10)=4\varphi(10) = 4 confirms the count. Every order in the table divides 10.

Example 2: Is U(9)U(9) cyclic?

Solution. U(9)={1,2,4,5,7,8}U(9) = \{1, 2, 4, 5, 7, 8\}, the residues coprime to 9, so U(9)=φ(9)=6|U(9)| = \varphi(9) = 6.

Try 2 as a generator, computing powers mod 9:

21=2,22=4,23=8,24=167,25=145,26=1012^1 = 2, \quad 2^2 = 4, \quad 2^3 = 8, \quad 2^4 = 16 \equiv 7, \quad 2^5 = 14 \equiv 5, \quad 2^6 = 10 \equiv 1

All six elements appear before returning to 1. Yes, cyclic, with U(9)=2Z6U(9) = \langle 2 \rangle \cong \mathbb{Z}_6.

Contrast U(8)={1,3,5,7}U(8) = \{1,3,5,7\} from an earlier lesson, where every element squares to 1, so it is not cyclic. Whether U(n)U(n) is cyclic is a genuinely delicate question: it is cyclic exactly when nn is 1,2,41, 2, 4, a power of an odd prime, or twice such a power.

Example 3: Find all generators of Z18\mathbb{Z}_{18}.

Solution. Need gcd(k,18)=1\gcd(k, 18) = 1 with 18=23218 = 2 \cdot 3^2, so exclude multiples of 2 and 3.

{1,5,7,11,13,17}\{1, 5, 7, 11, 13, 17\}

Six generators, and φ(18)=181223=6\varphi(18) = 18 \cdot \frac{1}{2} \cdot \frac{2}{3} = 6. ✓

Example 4: Find the subgroup of order 6 in Z24\mathbb{Z}_{24}.

Solution. For a subgroup of order dd in Zn\mathbb{Z}_n, the generator is n/dn/d. Here 24/6=424/6 = 4:

4={0,4,8,12,16,20}\langle 4 \rangle = \{0, 4, 8, 12, 16, 20\}

Six elements ✓. And it is the only subgroup of order 6, by the classification of cyclic subgroups.

Example 5: The order of an element in a product.

Find the order of (2,3)(2, 3) in Z4×Z6\mathbb{Z}_4 \times \mathbb{Z}_6.

Solution. The order of a pair is the least common multiple of the component orders.

In Z4\mathbb{Z}_4: 2=4gcd(2,4)=2|2| = \frac{4}{\gcd(2,4)} = 2. In Z6\mathbb{Z}_6: 3=6gcd(3,6)=2|3| = \frac{6}{\gcd(3,6)} = 2.

(2,3)=lcm(2,2)=2|(2,3)| = \operatorname{lcm}(2, 2) = 2

Check directly: (2,3)+(2,3)=(4mod4,6mod6)=(0,0)(2,3) + (2,3) = (4 \bmod 4, 6 \bmod 6) = (0,0). ✓

Since Z4×Z6=24|\mathbb{Z}_4 \times \mathbb{Z}_6| = 24 and the largest possible element order is lcm(4,6)=12<24\operatorname{lcm}(4,6) = 12 < 24, no element generates the group, so it is not cyclic.

Example 6: Prove every group of order 5 is cyclic.

Solution. Let G=5|G| = 5 and pick aea \ne e. Consider H=aH = \langle a \rangle.

HH is a subgroup, so by Lagrange’s theorem H|H| divides 5. The divisors of 5 are 1 and 5.

H=1|H| = 1 would mean H={e}H = \{e\}, contradicting aHa \in H with aea \ne e.

So H=5=G|H| = 5 = |G|, giving H=GH = G. Therefore GG is cyclic and GZ5G \cong \mathbb{Z}_5. ∎

The same argument works for any prime, so there is exactly one group of each prime order.

Diffie-Hellman key exchange picks a large prime pp and a generator gg of the cyclic group U(p)U(p). Alice sends gag^a, Bob sends gbg^b, and each computes gabg^{ab}. An eavesdropper sees gag^a and gbg^b and must solve the discrete logarithm problem to recover aa. Generating the whole group matters: if gg generated only a small subgroup, the search space would collapse and the scheme would break. Choosing a bad generator is a real class of implementation bug.

Pseudorandom number generators. A linear congruential generator computes xn+1=(axn+c)modmx_{n+1} = (ax_n + c) \bmod m. Its period is maximal exactly when certain coprimality conditions hold, which is the same gcd condition that decides generators in Zm\mathbb{Z}_m. Get it wrong and your “random” sequence cycles after a few hundred values.

The circle of fifths. Pitch classes form Z12\mathbb{Z}_{12}, and moving up a fifth is adding 7. Since gcd(7,12)=1\gcd(7,12) = 1, repeated fifths visit all twelve keys before returning, which is why the circle of fifths closes exactly once around. Stacking major thirds instead means adding 4, and gcd(4,12)=4\gcd(4,12) = 4, so you get a 3-cycle: an augmented triad.

Gear ratios and cicadas. Two meshed gears with mm and nn teeth return to their starting alignment after lcm(m,n)\operatorname{lcm}(m,n) teeth, so coprime tooth counts spread wear evenly. The same arithmetic explains why periodical cicadas emerge on 13- and 17-year cycles: prime periods maximize the time before re-synchronizing with a predator’s cycle.

Hash tables. Open addressing with a probe step kk modulo table size mm visits every slot exactly when gcd(k,m)=1\gcd(k, m) = 1. Implementations often pick a prime table size for precisely this reason: with mm prime, any nonzero step works.

What is the order of the element 8 in ℤ₁₂?
How many generators does ℤ₂₀ have?
Which statement is true?
Which subgroup of ℤ₃₀ has order 5?
Why is every group of prime order p cyclic?
Is ℤ₄ × ℤ₆ cyclic?