Primitive Root - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


NumberTheory

  

PrimitiveRoot

  

primitive root modulo n

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

PrimitiveRoot(n, options)

Parameters

n

-

positive integer

options

-

(optional) at most one of greaterthan = m or ith = i, where m is a non-negative integer and i is a positive integer

Description

• 

The PrimitiveRoot(n) command returns the smallest primitive root modulo n, if it exists.

• 

The PrimitiveRoot(n, greaterthan = m) command returns the smallest primitive root modulo n greater than m.

• 

The PrimitiveRoot(n, ith = i) command returns the ith smallest primitive root modulo n.

• 

If the required primitive root does not exist, then an error message is displayed.

• 

The integers that are coprime to n form a group of order Totient(n) under multiplication modulo n. If this group is cyclic, then a generator is called a primitive root modulo n. That is, if p is a primitive root modulo n, then every integer coprime to n is congruent to some power of p modulo n.

• 

If a primitive root modulo n exists, then the number of primitive roots is Totient(Totient(n)).

Examples

(1)

(2)

So  is the only primitive root modulo .

(3)

(4)

So there are two primitive roots modulo .

(5)

Both  and  are generators for the group of units under multiplication modulo .

(6)

Since the maximal order modulo  is less than , a primitive root does not exist and an error message is displayed.

(7)

(8)

Error, (in NumberTheory:-PrimitiveRoot) there does not exist a primitive root modulo 8

List all the primitive roots modulo , if any exist.

(9)

(10)

Compatibility

• 

The NumberTheory[PrimitiveRoot] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

NumberTheory

NumberTheory[MultiplicativeOrder]

NumberTheory[PseudoPrimitiveRoot]

 


Download Help Document