In modular arithmetic, a number g is a primitive root modulo n if every number a coprime to n is congruent to a power of g modulo n. That is, g is a primitive root modulo n, if for every integer a coprime to n, there is some integer k for which gᵏ ≡ a.
What are primitive roots?
A primitive root mod n is an integer g such that every integer relatively prime to n is congruent to a power of g mod n. ... That is, the integer g is a primitive root (mod n) if for every number a relatively prime to n there is an integer z such that.
How do you find a primitive root?
1- Euler Totient Function phi = n-1 [Assuming n is prime] 1- Find all prime factors of phi. 2- Calculate all powers to be calculated further using (phi/prime-factors) one by one. 3- Check for all numbered for all powers from i=2 to n-1 i.e. (i^ powers) modulo n. 4- If it is 1 then 'i' is not a primitive root of n.