First time here? Check out the FAQ!
answered 2014-02-09 07:47:19 +0100
Here is another option. I think you are trying to sum the roots of unity.
n=10 for i in range(1,n): v=solve(x^i - 1,x) roots=map(lambda q: q.rhs(),v) print roots sum=add(roots).n() print sum