Primitive root modulo n

generator of the multiplicative group of integers modulo n

In modular arithmetic, a number g is a primitive root modulo n, if every number m from 1..(n-1) can be expressed in the form of . As an example, 3 is a primitive root modulo 7:

All the elements of the group modulo 7 can be expressed that way. The number 2 is no primitive root modulo 7, because

and