Question: How do I create Fourier Series to Square Waveform animation?

I've been instructed to create an animation showing the changing plots of a single square waveform using 5,10,20,40,80,160,320, and 640 terms in my Fourier series. This is my code right now: 


with (plots):
L := [seq(2^i, i = 0 .. 6)];

[1, 2, 4, 8, 16, 32, 64]

animate( plot, [2/((2*n-1)*Pi))*sin((2*n-1)*Pi*x], n=L);
Error, `)` unexpected


It doesn't work. Can anyone explain what I'm doing wrong, or how to solve my question?

Please Wait...