Primitive Root Modulo N
   HOME

TheInfoList



OR:

In
modular arithmetic In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book ...
, a number is a primitive root modulo  if every number
coprime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
to is
congruent Congruence may refer to: Mathematics * Congruence (geometry), being the same size and shape * Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure * In mod ...
to a power of modulo . That is, is a ''primitive root modulo''  if for every integer coprime to , there is some integer for which ≡ (mod ). Such a value is called the index or
discrete logarithm In mathematics, for given real numbers ''a'' and ''b'', the logarithm log''b'' ''a'' is a number ''x'' such that . Analogously, in any group ''G'', powers ''b'k'' can be defined for all integers ''k'', and the discrete logarithm log''b' ...
of to the base modulo . So is a ''primitive root modulo''  if and only if is a
generator Generator may refer to: * Signal generator, electronic devices that generate repeating or non-repeating electronic signals * Electric generator, a device that converts mechanical energy to electrical energy. * Generator (circuit theory), an eleme ...
of the multiplicative group of integers modulo .
Gauss Johann Carl Friedrich Gauss (; german: Gauß ; la, Carolus Fridericus Gauss; 30 April 177723 February 1855) was a German mathematician and physicist who made significant contributions to many fields in mathematics and science. Sometimes refer ...
defined primitive roots in Article 57 of the ''
Disquisitiones Arithmeticae The (Latin for "Arithmetical Investigations") is a textbook of number theory written in Latin by Carl Friedrich Gauss in 1798 when Gauss was 21 and first published in 1801 when he was 24. It is notable for having had a revolutionary impact on th ...
'' (1801), where he credited
Euler Leonhard Euler ( , ; 15 April 170718 September 1783) was a Swiss mathematician, physicist, astronomer, geographer, logician and engineer who founded the studies of graph theory and topology and made pioneering and influential discoveries in ma ...
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
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
. In fact, the ''Disquisitiones'' contains two proofs: The one in Article 54 is a nonconstructive
existence proof In mathematics, a constructive proof is a method of proof that demonstrates the existence of a mathematical object by creating or providing a method for creating the object. This is in contrast to a non-constructive proof (also known as an existenc ...
, while the proof in Article 55 is
constructive Although the general English usage of the adjective constructive is "helping to develop or improve something; helpful to someone, instead of upsetting and negative," as in the phrase "constructive criticism," in legal writing ''constructive'' has ...
.


Elementary example

The number 3 is a primitive root modulo 7 because :: \begin 3^1 &=& 3^0 \times 3 &\equiv& 1 \times 3 &=& 3 &\equiv& 3 \pmod 7 \\ 3^2 &=& 3^1 \times 3 &\equiv& 3 \times 3 &=& 9 &\equiv& 2 \pmod 7 \\ 3^3 &=& 3^2 \times 3 &\equiv& 2 \times 3 &=& 6 &\equiv& 6 \pmod 7 \\ 3^4 &=& 3^3 \times 3 &\equiv& 6 \times 3 &=& 18 &\equiv& 4 \pmod 7 \\ 3^5 &=& 3^4 \times 3 &\equiv& 4 \times 3 &=& 12 &\equiv& 5 \pmod 7 \\ 3^6 &=& 3^5 \times 3 &\equiv& 5 \times 3 &=& 15 &\equiv& 1 \pmod 7 \\ 3^7 &=& 3^6 \times 3 &\equiv& 1 \times 3 &=& 3 &\equiv& 3 \pmod 7 \\ \end Here we see that the
period Period may refer to: Common uses * Era, a length or span of time * Full stop (or period), a punctuation mark Arts, entertainment, and media * Period (music), a concept in musical composition * Periodic sentence (or rhetorical period), a concept ...
of 3 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 ( modulo ) always repeats after some value of , since modulo  produces a finite number of values. If is a primitive root modulo  and is prime, then the period of repetition is Permutations created in this way (and their circular shifts) have been shown to be Costas arrays.


Definition

If is a positive integer, the integers from 0 to that are
coprime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
to (or equivalently, the
congruence class In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book ...
es coprime to ) form a
group A group is a number of persons or things that are located, gathered, or classed together. Groups of people * Cultural group, a group whose members share the same cultural identity * Ethnic group, a group whose members share the same ethnic ide ...
, with multiplication modulo as the operation; it is denoted by \mathbb, and is called the
group of units In algebra, a unit of a ring is an invertible element for the multiplication of the ring. That is, an element of a ring is a unit if there exists in such that vu = uv = 1, where is the multiplicative identity; the element is unique for this ...
modulo , or the group of primitive classes modulo . As explained in the article multiplicative group of integers modulo , this multiplicative group (\mathbb) is
cyclic Cycle, cycles, or cyclic may refer to: Anthropology and social sciences * Cyclic history, a theory of history * Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr. * Social cycle, various cycles in s ...
if and only if is equal to 2, 4, , or 2 where is a power of an odd
prime number A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
.. When (and only when) this group \mathbb is cyclic, a
generator Generator may refer to: * Signal generator, electronic devices that generate repeating or non-repeating electronic signals * Electric generator, a device that converts mechanical energy to electrical energy. * Generator (circuit theory), an eleme ...
of this cyclic group is called a primitive root modulo (or in fuller language primitive root of unity modulo , emphasizing its role as a fundamental solution of the
roots of unity In mathematics, a root of unity, occasionally called a de Moivre number, is any complex number that yields 1 when raised to some positive integer power . Roots of unity are used in many branches of mathematics, and are especially important in ...
polynomial equations X − 1 in the ring \mathbb), or simply a primitive element of \mathbb. When \mathbb is non-cyclic, such primitive elements mod do not exist. Instead, each prime component of has its own sub-primitive roots (see in the examples below). For any (whether or not \mathbb is cyclic), the order of \mathbb is given by
Euler's totient function In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...
() . And then,
Euler's theorem In number theory, Euler's theorem (also known as the Fermat–Euler theorem or Euler's totient theorem) states that, if and are coprime positive integers, and \varphi(n) is Euler's totient function, then raised to the power \varphi(n) is congru ...
says that for every coprime to ; the lowest power of that is congruent to 1 modulo is called the
multiplicative order In number theory, given a positive integer ''n'' and an integer ''a'' coprime to ''n'', the multiplicative order of ''a'' modulo ''n'' is the smallest positive integer ''k'' such that a^k\ \equiv\ 1 \pmod n. In other words, the multiplicative order ...
of modulo . In particular, for to be a primitive root modulo , () has to be the smallest power of that is congruent to 1 modulo .


Examples

For example, if then the elements of \mathbb are the congruence classes ; there are of them. Here is a table of their powers modulo 14: x x, x2, x3, ... (mod 14) 1 : 1 3 : 3, 9, 13, 11, 5, 1 5 : 5, 11, 13, 9, 3, 1 9 : 9, 11, 1 11 : 11, 9, 1 13 : 13, 1 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 The elements of \mathbb are the congruence classes ; there are of them. x x, x2, x3, ... (mod 15) 1 : 1 2 : 2, 4, 8, 1 4 : 4, 1 7 : 7, 4, 13, 1 8 : 8, 4, 2, 1 11 : 11, 1 13 : 13, 4, 7, 1 14 : 14, 1 Since there is no number whose order is 8, there are no primitive roots modulo 15. Indeed, , where is the
Carmichael function In number theory, a branch of mathematics, the Carmichael function of a positive integer is the smallest positive integer such that :a^m \equiv 1 \pmod holds for every integer coprime to . In algebraic terms, is the exponent of the multip ...
.


Table of primitive roots

Numbers n that have a primitive root are of the shape :n \in \ , := These are the numbers n with \varphi(n) = \lambda(n), kept also in the sequence in the
OEIS The On-Line Encyclopedia of Integer Sequences (OEIS) is an online database of integer sequences. It was created and maintained by Neil Sloane while researching at AT&T Labs. He transferred the intellectual property and hosting of the OEIS to the ...
. The following table lists the primitive roots modulo up to n=31:


Properties

Gauss proved that for any prime number (with the sole exception of the product of its primitive roots is congruent to 1 modulo . He also proved that for any prime number , the sum of its primitive roots is congruent to ( − 1) modulo , where is the
Möbius function The Möbius function is a multiplicative function in number theory introduced by the German mathematician August Ferdinand Möbius (also transliterated ''Moebius'') in 1832. It is ubiquitous in elementary and analytic number theory and most oft ...
. For example, : E.g., the product of the latter primitive roots is 2^6\cdot 3^4\cdot 7\cdot 11^2\cdot 13\cdot 17 = 970377408 \equiv 1 \pmod, and their sum is 123 \equiv -1 \equiv \mu(31-1) \pmod. If a is a primitive root modulo the prime p, then a^\frac\equiv -1 \pmod p.
Artin's conjecture on primitive roots In number theory, Artin's conjecture on primitive roots states that a given integer ''a'' that is neither a square number nor −1 is a primitive root modulo infinitely many primes ''p''. The conjecture also ascribes an asymptotic density to the ...
states that a given integer that is neither a perfect square nor −1 is a primitive root modulo infinitely many
primes A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
.


Finding primitive roots

No simple general formula to compute primitive roots modulo is known. There are however methods to locate a primitive root that are faster than simply trying out all candidates. If the
multiplicative order In number theory, given a positive integer ''n'' and an integer ''a'' coprime to ''n'', the multiplicative order of ''a'' modulo ''n'' is the smallest positive integer ''k'' such that a^k\ \equiv\ 1 \pmod n. In other words, the multiplicative order ...
(its
exponent Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
) of a number modulo is equal to \varphi(n) (the order of \mathbb), then it is a primitive root. In fact the converse is true: If is a primitive root modulo , then the multiplicative order of is \varphi(n) = \lambda(n)~. We can use this to test a candidate to see if it is primitive. For n > 1 first, compute \varphi(n)~. Then determine the different
prime factor A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
s of \varphi(n), say 1, ..., . Finally, compute :g^\bmod n \qquad\mbox i=1,\ldots,k using a fast algorithm for
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie-Hellman Key Exchange and RSA public/private keys. Modul ...
such as
exponentiation by squaring Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
. A number for which these results are all different from 1 is a primitive root. The number of primitive roots modulo , if there are any, is equal to :\varphi\left(\varphi(n)\right) since, in general, a cyclic group with elements has \varphi(r) generators, with being the integers coprime to , which generate . For prime , this equals \varphi(n-1), and since n / \varphi(n-1) \in O(\log\log n) the generators are very common among and thus it is relatively easy to find one. If is a primitive root modulo , then is also a primitive root modulo all powers unless −1 ≡ 1 (mod 2); in that case, + is. If is a primitive root modulo , then is also a primitive root modulo all smaller powers of . If is a primitive root modulo , then either or + (whichever one is odd) is a primitive root modulo 2. Finding primitive roots modulo is also equivalent to finding the roots of the ( − 1)st
cyclotomic polynomial In mathematics, the ''n''th cyclotomic polynomial, for any positive integer ''n'', is the unique irreducible polynomial with integer coefficients that is a divisor of x^n-1 and is not a divisor of x^k-1 for any Its roots are all ''n''th primiti ...
modulo .


Order of magnitude of primitive roots

The least primitive root modulo (in the range 1, 2, ..., is generally small.


Upper bounds

Burgess (1962) proved that for every ''ε'' > 0 there is a such that g_p \leq C\,p^~. Grosswald (1981) proved that if p > e^ \approx 10^, then g_p < p^~. Shoup (1990, 1992) proved, assuming the
generalized Riemann hypothesis The Riemann hypothesis is one of the most important conjectures in mathematics. It is a statement about the zeros of the Riemann zeta function. Various geometrical and arithmetical objects can be described by so-called global ''L''-functions, whic ...
, that


Lower bounds

Fridlander (1949) and Salié (1950) proved that there is a positive constant such that for infinitely many primes It can be proved in an elementary manner that for any positive integer there are infinitely many primes such that < <


Applications

A primitive root modulo is often used in
pseudorandom number generators A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), is an algorithm for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers. The PRNG-generate ...
and
cryptography Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or ''-logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adver ...
, including the
Diffie–Hellman key exchange Diffie–Hellman key exchangeSynonyms of Diffie–Hellman key exchange include: * Diffie–Hellman–Merkle key exchange * Diffie–Hellman key agreement * Diffie–Hellman key establishment * Diffie–Hellman key negotiation * Exponential key exc ...
scheme. Sound diffusers have been based on number-theoretic concepts such as primitive roots and
quadratic residues In number theory, an integer ''q'' is called a quadratic residue modulo ''n'' if it is congruent to a perfect square modulo ''n''; i.e., if there exists an integer ''x'' such that: :x^2\equiv q \pmod. Otherwise, ''q'' is called a quadratic non ...
.


See also

*
Dirichlet character In analytic number theory and related branches of mathematics, a complex-valued arithmetic function \chi:\mathbb\rightarrow\mathbb is a Dirichlet character of modulus m (where m is a positive integer) if for all integers a and b: :1)   \chi ...
*
Full reptend prime In number theory, a full reptend prime, full repetend prime, proper primeDickson, Leonard E., 1952, ''History of the Theory of Numbers, Volume 1'', Chelsea Public. Co. or long prime in base ''b'' is an odd prime number ''p'' such that the Fermat q ...
* Gauss's generalization of Wilson's theorem *
Multiplicative order In number theory, given a positive integer ''n'' and an integer ''a'' coprime to ''n'', the multiplicative order of ''a'' modulo ''n'' is the smallest positive integer ''k'' such that a^k\ \equiv\ 1 \pmod n. In other words, the multiplicative order ...
* Quadratic residue * Root of unity modulo


Footnotes


References


Sources

* * The ''
Disquisitiones Arithmeticae The (Latin for "Arithmetical Investigations") is a textbook of number theory written in Latin by Carl Friedrich Gauss in 1798 when Gauss was 21 and first published in 1801 when he was 24. It is notable for having had a revolutionary impact on th ...
'' 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. * * * * *


Further reading

*.


External links

* * * {{cite web , title = Primitive roots calculator , website = BlueTulip , url = http://www.bluetulip.org/programs/primitive.html Modular arithmetic