# Plotting partial sum with complex number

$$\sum_{n=1}^{N} e^{2\pi in\sqrt2}$$

We have to use Accumulate and ListLinePlot, and my implementation so far with upper bound 50 (any upper bound is fine) is having trouble with the complex number. I tried to use Relm, but same thing happens.

Sums= Accumulate[e^(2*pi*I*#*sqrt[2]) & /@ Range[50]];
ListLinePlot[Sums, PlotRange -> All, Filling -> Axis]


Your code has many syntax errors, read the manual. And a hint, do not use names that start with a capital letter. Keywords in MMA start like this.

Here is the changed code:

sums = Accumulate[E^(2*Pi*I*#*Sqrt[2]) & /@ Range[50]] // N;
sums = ReIm /@ sums;
sums = ListLinePlot[sums, PlotRange -> All]


• Tyvm. This is much clearer and helped ne understand. Commented Nov 7, 2020 at 19:44
• Here is another hint for free: Multiplication by Exp[ I phi] is a rotation in the complex plane by the angle phi (in radians). Commented Nov 7, 2020 at 19:47

Since V12, there is ComplexListPlot:

ComplexListPlot[
Accumulate[E^(2*Pi*I*Range[50]*Sqrt[2])],
Joined -> True
]