Multiplicative Order Calculator

ord_n(a) = min k: aᵏ≡1

CalculatorsFreeNo Signup
4.3(360 reviews)
All Tools

Loading tool...

About Multiplicative Order Calculator

A multiplicative order calculator finding ord_n(a): the smallest positive k where aᵏ≡1 (mod n). Shows order divides φ(n), lists all elements of ⟨a⟩, and checks if a is a primitive root. Requires gcd(a,n)=1. Client-side.

Multiplicative Order Calculator Features

  • Order computation
  • ⟨a⟩ elements
  • Divides φ(n)
  • Primitive root?
  • Divisor check
Multiplicative order ord_n(a): smallest k>0 with aᵏ≡1 (mod n). Exists iff gcd(a,n)=1. Always divides φ(n) (Euler's theorem). a is a primitive root iff ord_n(a)=φ(n). Order determines the cyclic subgroup ⟨a⟩ = {a,a²,...,aᵏ=1}.

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

  1. 1Enter a.
  2. 2Enter n.
  3. 3Get order.
  4. 4View subgroup.
  5. 5Check primitive root.

Multiplicative Order Calculator — Frequently Asked Questions

How to compute order efficiently?+

Don't test all k up to φ(n). Instead: (1) Factor φ(n) = p₁^e₁·...·pₖ^eₖ. (2) Start with d=φ(n). (3) For each prime factor p of d: if a^(d/p) ≡ 1, replace d with d/p. (4) Final d is the order. This runs in O(log²n · #factors).

Why does order divide φ(n)?+

By Euler's theorem, a^φ(n) ≡ 1 (mod n) for gcd(a,n)=1. If ord(a)=k, then k|φ(n) because: dividing φ(n)=qk+r gives a^r ≡ 1, and since k is minimal, r=0. This is the division algorithm applied to group theory.

What determines which orders are possible?+

For prime p: orders must divide p−1. All divisors d of p−1 occur, with exactly φ(d) elements of order d. For composite n: possible orders are more restricted and depend on the structure of (Z/nZ)* as a product of cyclic groups.

Share this tool: