Divergent sums



Hi,

I looked a little into the bug 1945954 (simpsum/simplify_sum with
summand=f(i)+q) and noticed that there are many bugs with divergent
sums:

(%i2) simpsum:true$
(%i3) sum(2^n-3^n,n,1,inf);
(%o3)                                 inf
(%i4) sum(3^n-2^n,n,1,inf);
(%o4)                                minf
(%i5) sum((-3)^n,n,1,inf);
(%o5)                                minf

Basically, if the sum is divergent, maxima answers inf, minf or und,
but a lot of times incorrectly.

I propose to change that so that for divergent sums maxima returns und
or signals an error. This would make sum behave more like integrate:

(%i8) integrate(1/x,x,1,inf);
Integral is divergent
 -- an error.  To debug this try debugmode(true);

and remove some bugs.

-- 
Andrej