Problem with an infinite series

40 views
Skip to first unread message

Aaron Tresham

unread,
Nov 17, 2025, 10:23:53 PM (6 days ago) Nov 17
to sage-support
I have used SageMath within CoCalc for teaching Calculus 2 for several years.

In past semesters, the following code produced the output "ind":

     var('n')
     sum(n*(-1)^n,n,1,oo)

This is expected, since the series diverges.

However, this semester I changed the kernel from SageMath 10.4 to the current SageMath 10.7. Now this same code produces the output "-1/4" [I believe 10.5 and 10.6 behave the same way as 10.7.]

I have my students compute the value of several similar series (replacing the -1 in the code above with -2, -1/2, 1/2, 1, and 2), and all the others are behaving the same way they always have. It is only this series which is giving me an unexpected output.

Has anyone else encountered this issue?

Thanks,
Aaron

Nils Bruin

unread,
Nov 17, 2025, 10:38:54 PM (6 days ago) Nov 17
to sage-support
I can confirm the behaviour you're observing ... It's really unfortunate!. This would be a result produced by maxima, so most likely it's a change due to a change in maxima version. I would call it a bug. One should probably try to reproduce it in maxima proper and then report it to maxima. Hopefully they can fix it.

In maxima 5.47.0 I get:

(%i1) load(simplify_sum)$
(%i2) simplify_sum( sum(n*(-1)^n,n,1,inf));
-1/4

This happens both on sage's ECL based one and on the system maxima (running on SBCL). So I think this behaviour tracks decisively to maxima.

kcrisman

unread,
Nov 18, 2025, 7:59:27 AM (6 days ago) Nov 18
to sage-support
I've opened https://sourceforge.net/p/maxima/bugs/4634/ for this, and hopefully we'll hear back.  Can someone open a corresponding Sage ticket which will eventually get a doctest for the same?  Thanks! 

Antonio Rojas

unread,
Nov 18, 2025, 8:14:01 AM (6 days ago) Nov 18
to sage-support
This is fixed in maxima 5.48. The upgrade ticket is https://github.com/sagemath/sage/pull/40679

kcrisman

unread,
Nov 18, 2025, 9:42:01 AM (5 days ago) Nov 18
to sage-support
Thanks for pointing that one out, that's great.  

(Though note that apparently the "correct" answer is "und" not "ind", according to the latest comment on the Sourceforge ticket!)

Aaron Tresham

unread,
Nov 18, 2025, 12:55:27 PM (5 days ago) Nov 18
to sage-support
Thank you all for looking into this. I'm happy to hear that the bug has been fixed in Maxima. I'm sure the fix will work it's way into Sage soon enough.

By the way, this sum did return "und" a few years ago, and later the answer changed to "ind" (before changing to -1/4). I agree that und is better than ind (as far as I understand the difference between these).

Aaron

Reply all
Reply to author
Forward
0 new messages