How to Solve for Primitive Roots

Solving for primitive roots is a helpful skill in cryptography and number theory. A number, "g," is a primitive root for a given prime number, "p," if g (mod p) has modulo order p-1. This means that the list of "g^1 mod p," "g^2 mod p" and up to "g^(p-1) mod p" contain all the integers from 1-(p-1). There is no known algorithm for efficiently calculating primitive roots. The simple method for calculating primitive roots is to try each possible number from 2 up to (p-1).

Instructions

    • 1

      Choose a prime number, "p," such as 5. A prime number has no divisors other than itself and 1. For example, 4 is not a prime number because "4/2 = 2"; so it has 2 as a divisor.

    • 2

      Calculate "2^n mod p" for each integer "n" from 1-(p-1). Using the example, "p" is 5, so you calculate "2^n mod 5" for 1-4. This produces the list:

      2^1 = 2 mod 5 = 2

      2^2 = 4 mod 5 = 4

      2^3 = 8 mod 5 = 3

      2^4 = 16 mod 5 = 1

    • 3

      Check if the list of numbers contains all the possible remainders mod 5. The list 2, 4, 3 and 1 qualifies, so 2 is a primitive root modulo 5. If the list had instead been 2, 1, 4 and 1, which it is for 4, then it would not be a primitive root because it is missing the number 3.

    • 4

      Repeat the previous step for all integers less than 5. The number 3 is also a primitive root modulo 5, but 4 is not; so 2 and 3 are the primitive roots for 5.

Learnify Hub © www.0685.com All Rights Reserved