Question: Strange result for the evaluation of a sum

Hello guys,

I was just playing around with the Shanks transformation of a power series, when I noticed that polynomials aren't evaluated as I would expect.
I created this minimal working example; the function s should evaluate for z=0 to a[0], however it return simply 0.
Is there something I messed up?

restart

s := proc (n, z) options operator, arrow; sum(a[k]*z^k, k = 0 .. n) end proc;

proc (n, z) options operator, arrow; sum(a[k]*z^k, k = 0 .. n) end proc

(1)

series(s(n, z), z = 0)

series(a[0]+a[1]*z+a[2]*z^2+a[3]*z^3+a[4]*z^4+a[5]*z^5+O(z^6),z,6)

(2)

The value of s in z=0 should be a[0], however it returns 0:

s(n, 0)

0

(3)

s(1, 0)

0

(4)

Download evaluate_sum.mw

 

Thanks for your help,

Sören

Please Wait...