How to Use
Enter n:
- Exists?: Check if primitive roots exist
- Smallest: Find smallest primitive root
- All: List all primitive roots
Existence
Primitive roots exist mod n iff n = 1, 2, 4, pᵏ, or 2pᵏ (p odd prime, k≥1). For n=8,12,15,... no primitive root exists because (Z/nZ)* is not cyclic.
Applications
- Diffie-Hellman key exchange
- ElGamal encryption
- Discrete logarithm
- Number-theoretic transforms
Step-by-Step Instructions
- 1Enter n.
- 2Check existence.
- 3Find smallest root.
- 4View all roots.
- 5See power table.