| 1 | initial version |
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
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.