Skip to main content
2 of 2
added 98 characters in body
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Python 2, 72 62 bytes

n=2;x=[] exec'x+=n/2*[1j**n];n+=1;'*input() print-sum(x[:n-2]) 

Thanks to @xnor for suggesting and implementing the quarter-turn idea, which saved 10 bytes.

Indexing is 0-based, output is a complex number. Test it on Ideone.

Dennis
  • 211.7k
  • 41
  • 380
  • 830