Question: Problem with a function within sum

restart; 

g := proc (i)
if i = 1 then a else 0 fi
end proc:

h := sum(g(i), i = 1 .. f);

The result is h:=0 instead of h:=a. What's wrong?

Please Wait...