Wolfram Research

Function Repository Resource:

PrimitiveRootOfUnityList

Source Notebook

Get the set of primitive nth roots of unity

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["PrimitiveRootOfUnityList"][n]

returns a list of the nth primitive roots of unity.

Details and Options

An nth root of unity, x, is called a primitive nth root of unity if xm≠1 for any m<n. For example, the complete set of fourth roots of unity is {-ⅈ, ⅈ, 1, -1}, but only ±ⅈ are primitive fourth roots.

Examples

Basic Examples

Find the primitive fifth roots of unity:

In[1]:=
ResourceFunction["PrimitiveRootOfUnityList"][5]
Out[1]=

Notice that 1 is missing from the list above, as compared with the full list of the fifth roots of unity returned by ResourceFunction["ComplexRoots"]:

In[2]:=
ResourceFunction["ComplexRoots"][1, 5]
Out[2]=

Resource History

See Also

License Information