Check primitive roots using reliable number theory steps. Verify generators, ranges, and modular powers quickly. Export results for classes, audits, and practice teams daily.
| Modulus n | φ(n) | Primitive Roots Exist? | Sample Primitive Roots |
|---|---|---|---|
| 7 | 6 | Yes | 3, 5 |
| 9 | 6 | Yes | 2, 5 |
| 10 | 4 | Yes | 3, 7 |
| 14 | 6 | Yes | 3, 5 |
| 15 | 8 | No | None |
| 17 | 16 | Yes | 3, 5, 6, 7 |
1) Existence condition: Primitive roots modulo n exist only when n = 2, n = 4, n = pk, or n = 2pk, where p is an odd prime.
2) Euler totient: The calculator computes φ(n) from the prime factorization of n using:
φ(n) = n × Π(1 − 1/p)
3) Primitive root test: Let q be each distinct prime divisor of φ(n). A candidate g is a primitive root when:
g^φ(n) ≡ 1 (mod n) and g^(φ(n)/q) ≠ 1 (mod n) for all q
This verifies that the multiplicative order of g is exactly φ(n).
Primitive roots are not available for every modulus, so the calculator starts with a structural test. It confirms whether n is 2, 4, an odd prime power, or twice an odd prime power. This rule avoids unnecessary searches. For example, n=15 fails immediately, while n=9 and n=14 pass. Early screening improves speed and helps users understand why some inputs cannot produce generators. It also explains failed cases clearly.
After the modulus passes the rule check, the calculator factors n and computes Euler's totient value φ(n). It uses the product form φ(n)=n×Π(1−1/p) over distinct prime divisors p. These outputs are displayed because primitive root testing depends on the order target φ(n). The factorization of φ(n) is also shown, giving the exact prime divisors required for candidate verification. For n=17, the displayed totient is 16.
A candidate g qualifies only when its multiplicative order modulo n equals φ(n). The calculator applies modular exponentiation to test this efficiently. First, it confirms g^φ(n) ≡ 1 (mod n). Next, for each prime divisor q of φ(n), it checks that g^(φ(n)/q) is not 1. Passing all checks proves g is a primitive root instead of a lower-order residue class element. This method matches standard number theory proofs.
Users control the search start, search end, and the maximum number of listed roots. The calculator still counts every primitive root found in the scanned interval, even when the displayed list is limited. A built-in cap of 200,000 scanned values prevents timeouts during large searches. After computing results, users can export a CSV or PDF summary for lessons, audits, handouts, or documentation archives. Displayed counts support benchmarking across experiments.
The result panel appears above the form after submission and highlights rule status, φ(n), factor data, first primitive root found, and scanned totals. A practical validation sequence compares n=7, where primitive roots include 3 and 5, against n=15, where none exist. This contrast shows both the theorem and the search workflow, giving students and analysts a transparent basis for modular arithmetic decisions. Exports preserve reproducible records for reviews.
1) What is a primitive root modulo n?
A primitive root is an integer g whose powers generate every value coprime to n. Its multiplicative order modulo n equals Euler's totient φ(n).
2) Why does the calculator sometimes report no primitive roots?
Primitive roots exist only for n equal to 2, 4, p^k, or 2p^k with odd prime p. Composite moduli like 15 fail this theorem.
3) Why are φ(n) and its prime divisors displayed?
They are required for the generator test. The calculator checks powers using each distinct prime divisor of φ(n) to prove the candidate order is maximal.
4) Does the listed root count equal all primitive roots modulo n?
Not always. The displayed list is limited by your Max Displayed Roots setting, but the calculator still reports how many primitive roots were found in the scanned interval.
5) Why is there a scan limit?
The 200,000-value scan cap prevents long searches from timing out on shared hosting. It keeps the page responsive while still supporting useful educational and analytical ranges.
6) When should I export CSV or PDF results?
Use CSV for data review, filtering, or batch documentation. Use PDF when you need a compact snapshot for reports, classes, or audit evidence.
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.