> > KostasSum(exp, [i,i1,i2], [j,j1,j2], ....).
>
> Yes, that's basically what I want, which is what Mathematica does.
> The reason I want that, as opposed to doing the nesting myself, is
> convenience. ...
> Are you saying that implementing this in Maxima is completely trivial?
> (Leaving simplification aside for the moment).
Well, it is completely trivial in the sense that there's nothing to
prevent you from using any notation you want, e.g. writing
KostasSum(...), but Maxima won't be able to do anything useful with it
until you define further simplifications etc. Maxima won't know that
i,j, etc. are bound variables in exp (well, it's not terribly smart
about that in general, but better than nothing); it won't know that i1
<= i <= i2, it won't know that KostasSum(0, ...) = 0, that
KostasSum(exp) = exp (trivial case), that KostasSum(exp,[i,i1,i2]) ==
sum(exp,i,i1,i2), that KostasSum(..., [k,0,0]) =
subst(0,k,KostasSum(...), etc.
Perhaps one way to approach this is to use KostasSum as an input and
output form, but do the internal calculations using normal Sum. Going
from Kostas sum to nested sums is trivial using Maxima macros; going
from nested sums to Kostas sums not much harder.
-s