How to Use
Enter a and n:
- ord: Smallest k with aᵏ≡1
- ⟨a⟩: Generated subgroup
- φ(n): Euler's totient
Properties
- ord_n(a) divides φ(n)
- ord_n(aⁱ) = ord_n(a)/gcd(i, ord_n(a))
- a is primitive root iff ord_n(a) = φ(n)
- Number of elements of order d: φ(d)
Efficient Computation
Factor φ(n). For each prime power p^e | φ(n), find smallest f where a^(φ(n)/pᶠ) ≡ 1. The order is φ(n) divided by all such prime powers. Much faster than testing all k.
Step-by-Step Instructions
- 1Enter a.
- 2Enter n.
- 3Get order.
- 4View subgroup.
- 5Check primitive root.