How can I define a function of the form
f(x1,x2,...,xn)=n∑i=0xi
I tried the following
sage: n = 2
sage: x = [ var('x_%d' % i) for i in range(n) ]
sage: f(x)=sum(x[i],i,0,n)
The last line gives me the error
"TypeError: 'sage.symbolic.expression.Expression' object does not support indexing".