galois.
primitive_roots
Finds all primitive n-th roots of unity that satisfy x^k = 1 (mod n).
n (int) – A positive integer n > 1.
An array of integer roots of unity modulo n.
np.ndarray