for _ in range(11): n=2;x=[] exec'x+=n/2*[1j**n];n+=1;'*input() print-sum(x[:n-2])
0 1 2 3 4 5 6 7 8 9 100
0 (1-0j) (1+1j) (-0+1j) (-1+1j) (-1-0j) (-1-1j) (-0-1j) (1-1j) (2-1j) (-5+5j)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!