Cyclic Group Calculator

Compute Zn and unit groups accurately quickly. Check cyclicity, generators, and subgroup elements automatically here. Download results, verify steps, and learn formulas clearly now.

Calculator

Choose a group model, enter parameters, then compute generators and orders.

U(n) includes only integers coprime to n.
Example: 12, 15, 17, 25.
Blank uses a = 1.
Caps subgroup and unit previews.
Turn off for faster output.

Example data table

Group n a Expected highlight
Additive Z_n 12 5 gcd(5,12)=1, so 5 generates Z_12.
Unit group U(n) 10 3 phi(10)=4, and 3 has order 4 (generator).
Unit group U(n) 12 5 U(12) is not cyclic by classification.

Formula used

How to use this calculator

  1. Select Additive Z_n for modular addition, or U(n) for modular multiplication on units.
  2. Enter a positive integer n. Enter an integer a (blank defaults to 1).
  3. Set a list limit to control table size.
  4. Click Compute to view results above the form.
  5. Use Download CSV or Download PDF to export the last computed output.

Operational meaning of cyclic generation

A cyclic structure compresses an entire group into one repeatable step. In Z_n, the generator test is gcd(a,n)=1. For n=12, a=5 gives gcd=1, so the subgroup size equals 12 and the sequence hits every residue once. When gcd(a,n)=d>1, the subgroup size becomes n/d; for n=12, a=4 yields size 3.

Orders as cycle lengths

The order of an element is the length of its orbit before returning to identity. Additively, ord(a)=n/gcd(a,n). With n=30 and a=12, gcd=6 and ord=5. Multiplicatively, ord(a) is the smallest k with a^k≡1 (mod n). For n=10 and a=3, ord=4, matching phi(10)=4.

Totient values and generator counts

phi(n) counts integers 1..n−1 that are coprime to n. It also equals the number of generators of Z_n. For n=15, phi(15)=15(1−1/3)(1−1/5)=8, meaning eight generators exist. In cyclic U(n), the generator count is phi(phi(n)); for n=10, phi(n)=4 and phi(4)=2.

Cyclicity classification for unit groups

Unit groups are not always cyclic. The known classification says U(n) is cyclic only for n=1,2,4,p^k, or 2p^k with odd prime p. This explains why U(12) fails: phi(12)=4, but no element reaches order 4. In contrast, n=14 fits 2·7, so U(14) is cyclic and contains generators.

Reading the Plotly sequence graph

The graph plots step index k on the x-axis and the subgroup element on the y-axis. A full-length orbit indicates generation. In Z_17 with a=3, the plotted values cover 0..16. In U(9) with a=2, the values cycle through units {1,2,4,8,7,5} with orbit length 6, equal to phi(9)=6, so 2 is a generator.

Export workflows and reproducibility

CSV exports keep numeric fields ready for audit: n, a, gcd, order, and subgroup listing. The PDF export provides a print-friendly snapshot for lectures and reports. Using list limits (10–500) prevents heavy pages for large n, while preserving correctness for computed invariants like phi(n) and element order.

FAQs

1) What does it mean that Z_n is cyclic?

It means there exists an element a such that repeated addition of a generates every residue class 0..n−1. The calculator checks this by gcd(a,n)=1 and shows the full sequence.

2) Why must a be coprime to n in U(n)?

U(n) contains only invertible residues modulo n. An element is invertible exactly when gcd(a,n)=1. Otherwise, multiplication cannot produce an identity cycle within U(n).

3) How is the multiplicative order computed efficiently?

The tool computes phi(n), factors it, and repeatedly tests reduced exponents. This avoids brute forcing all k, and typically finds the smallest k with a^k ≡ 1 (mod n) quickly.

4) Why can U(n) be non-cyclic even when phi(n) is small?

Some moduli create unit groups with multiple independent cycles. For example, U(12) has size 4 but splits into smaller cycles, so no element reaches order 4, and the group is not cyclic.

5) What does a truncated subgroup list affect?

Only the displayed table and graph are truncated. Core invariants such as gcd(a,n), phi(n), cyclicity classification, and computed order of a remain accurate for the provided inputs.

6) Which inputs are best for classroom demonstrations?

Try Z_12 with a=5 for a generator, Z_12 with a=4 for a proper subgroup, U(10) with a=3 for a cyclic unit group, and U(12) with a=5 to show a non-cyclic case.

Tip: For large n, keep list limit small for faster rendering.

Related Calculators

lagrange theorem calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.