galois.primitive_root

galois.primitive_root(n)[source]

Finds the first, smallest primitive n-th root of unity that satisfy x^k = 1 (mod n).

Parameters

n (int) – A positive integer n > 1.

Returns

The first, smallest primitive root of unity modulo n.

Return type

int