On Mon, Feb 25, 2008 at 12:24 AM, Edwin Woollett <woollett at charter.net> wrote:
> Can someone explain how maxima uses the index limits for the function nusum.
> Is there a simple explanation for the ouputs:
> ----------------------------------------
> nusum( j, j, 0, 2 ); ----> 3
> and
> nusum( j, j, 0, j ); ---> j*( j + 1 ) / 2
> -----------------------------------------------
The arguments for nusum are the same as for sum:
nusum(expression, variable, lower_bound, upper_bound).
Explanation for you examples:
nusum(j,j,0,2) = 0+1+2 = 3
nusum(j,j,0,j) = 0+1+2+...+j = j*(j+1)/2.
Maybe it is confusing that in the last example the upper limit for
summation is the same as summation variable. The example is equivalent
to nusum(i, i, 0, j).
HTH,
--
Andrej