In modular arithmetic, a number g is a primitive root modulo n if every number acoprime to n is congruent to a power of g modulo n. That is, g is a primitive root modulon if for every integer a coprime to n, there is some integer k for which gk ≡ a (mod n). Such a value k is called the index or discrete logarithm of a to the base g modulo n. So g is a primitive root modulon if and only if g is a generator of the multiplicative group of integers modulo n.
Gauss defined primitive roots in Article 57 of the Disquisitiones Arithmeticae (1801), where he credited Euler with coining the term. In Article 56 he stated that Lambert and Euler knew of them, but he was the first to rigorously demonstrate that primitive roots exist for a primen. In fact, the Disquisitiones contains two proofs: The one in Article 54 is a nonconstructive existence proof, while the proof in Article 55 is constructive.
A primitive root exists if and only if n is 1, 2, 4, pk or 2pk, where p is an odd prime and k > 0. For all other values of n the multiplicative group of integers modulo n is not cyclic.[1][2][3]
This was first proved by Gauss.[4]
Elementary example
The number 3 is a primitive root modulo 7[5] because
Here we see that the period of 3k modulo 7 is 6. The remainders in the period, which are 3, 2, 6, 4, 5, 1, form a rearrangement of all nonzero remainders modulo 7, implying that 3 is indeed a primitive root modulo 7. This derives from the fact that a sequence (gk modulo n) always repeats after some value of k, since modulo n produces a finite number of values. If g is a primitive root modulo n and n is prime, then the period of repetition is n − 1. Permutations created in this way (and their circular shifts) have been shown to be Costas arrays.
Definition
If n is a positive integer, the integers from 1 to n − 1 that are coprime to n (or equivalently, the congruence classes coprime to n) form a group, with multiplication modulon as the operation; it is denoted by × n, and is called the group of units modulo n, or the group of primitive classes modulo n. As explained in the article multiplicative group of integers modulo n, this multiplicative group (× n) is cyclicif and only ifn is equal to 2, 4, pk, or 2pk where pk is a power of an odd prime number.[6][2][7] When (and only when) this group × n is cyclic, a generator of this cyclic group is called a primitive root modulo n[8] (or in fuller language primitive root of unity modulo n, emphasizing its role as a fundamental solution of the roots of unity polynomial equations Xm − 1 in the ring n), or simply a primitive element of× n.
When × n is non-cyclic, such primitive elements mod n do not exist. Instead, each prime component of n has its own sub-primitive roots (see 15 in the examples below).
For any n (whether or not × n is cyclic), the order of × n is given by Euler's totient functionφ(n) (sequence A000010 in the OEIS). And then, Euler's theorem says that aφ(n) ≡ 1 (mod n) for every a coprime to n; the lowest power of a that is congruent to 1 modulo n is called the multiplicative order of a modulo n. In particular, for a to be a primitive root modulo n, aφ(n) has to be the smallest power of a that is congruent to 1 modulo n.
Examples
For example, if n = 14 then the elements of × n are the congruence classes {1, 3, 5, 9, 11, 13}; there are φ(14) = 6 of them. Here is a table of their powers modulo 14:
The order of 1 is 1, the orders of 3 and 5 are 6, the orders of 9 and 11 are 3, and the order of 13 is 2. Thus, 3 and 5 are the primitive roots modulo 14.
For a second example let n = 15 . The elements of × 15 are the congruence classes {1, 2, 4, 7, 8, 11, 13, 14}; there are φ(15) = 8 of them.
Since there is no number whose order is 8, there are no primitive roots modulo 15. Indeed, λ(15) = 4, where λ is the Carmichael function. (sequence A002322 in the OEIS)
Table of primitive roots
Numbers that have a primitive root are of the shape
No simple general formula to compute primitive roots modulo n is known.[a][b] There are however methods to locate a primitive root that are faster than simply trying out all candidates. If the multiplicative order (its exponent) of a number m modulo n is equal to (the order of × n), then it is a primitive root. In fact the converse is true: If m is a primitive root modulo n, then the multiplicative order of m is We can use this to test a candidate m to see if it is primitive.
For first, compute Then determine the different prime factors of , say p1, ..., pk. Finally, compute
^"One of the most important unsolved problems in the theory of finite fields is designing a fast algorithm to construct primitive roots. von zur Gathen & Shparlinski 1998, pp. 15–24
^"There is no convenient formula for computing [the least primitive root]." Robbins 2006, p. 159
^Feldman, Eliot (July 1995). "A reflection grating that nullifies the specular reflection: A cone of silence". J. Acoust. Soc. Am. 98 (1): 623–634. Bibcode:1995ASAJ...98..623F. doi:10.1121/1.413656.
Sources
Bach, Eric; Shallit, Jeffrey (1996). Efficient Algorithms. Algorithmic Number Theory. Vol. I. Cambridge, MA: The MIT Press. ISBN978-0-262-02405-1.
Carella, N. A. (2015). "Least Prime Primitive Roots". International Journal of Mathematics and Computer Science. 10 (2): 185–194. arXiv:1709.01172.
The Disquisitiones Arithmeticae has been translated from Gauss's Ciceronian Latin into English and German. The German edition includes all of his papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of the Gauss sum, the investigations into biquadratic reciprocity, and unpublished notes.
Gauss, Carl Friedrich (1965) [1801]. Untersuchungen über höhere Arithmetik [Studies of Higher Arithmetic] (in German). Translated by Maser, H. (2nd ed.). New York, NY: Chelsea. ISBN978-0-8284-0191-3.