The purpose of this task is to explore working with   complex numbers.



Task

Given   n,   find the   nth   roots of unity.




roots := n -> List([0 .. n-1], k -> E(n)^k);
 
r:=roots(7);
# [ 1, E(7), E(7)^2, E(7)^3, E(7)^4, E(7)^5, E(7)^6 ]
 
List(r, x -> x^7);
# [ 1, 1, 1, 1, 1, 1, 1 ]