Sage showed "TypeError: need a summation variable" when i used sum function with for loop
I try to make a summation list and the commands are below this:
sage: f = (2/n)*(sin(n*x)*(-1)^(n+1))
sage: funclist = [sum(f,n,1,20) for n in range(1,3)]
but i found an error message:
TypeError: need a summation variable
How to solve this problem?