PrimitiveRoot

PrimitiveRoot[n]
gives a primitive root of n.

PrimitiveRoot[n,k]
gives the smallest primitive root of n greater than or equal to k.

DetailsDetails

  • PrimitiveRoot[n] gives a generator for the multiplicative group of integers modulo n relatively prime to n.
  • PrimitiveRoot[n] returns unevaluated if n is not 2, 4, an odd prime power, or twice an odd prime power.
  • PrimitiveRoot[n,1] computes the smallest primitive root of n.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

A primitive root of 9 is 2:

In[1]:=
Click for copyable input
Out[1]=

The primitive root generates all integers modulo 9 that are relatively prime to 9:

In[2]:=
Click for copyable input
Out[2]=

A primitive root of 10:

In[1]:=
Click for copyable input
Out[1]=

The smallest primitive root of 10:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2007
(6.0)
| Updated in 2015
(10.3)
Translate this page: