Opened 3 years ago
Closed 3 weeks ago
#27092 closed defect (fixed)
Add doctest that sum(binomial(1, n), n, 0, oo) equals 2
Reported by:  rburing  Owned by:  

Priority:  major  Milestone:  sage9.5 
Component:  symbolics  Keywords:  maxima, binomial, series 
Cc:  slelievre  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Samuel Lelièvre 
Report Upstream:  Fixed upstream, in a later stable release.  Work issues:  
Branch:  1cbe5bb (Commits, GitHub, GitLab)  Commit:  1cbe5bb59008986f08eafbd541ffd7ee258c8d26 
Dependencies:  Stopgaps: 
Description (last modified by )
As reported at
past versions of Sage had:
sage: sum(binomial(1, n), n, 0, oo, algorithm='sympy') # correct 2 sage: sum(binomial(1, n), n, 0, oo) # incorrect 3
The error can be traced back to Maxima as follows: evaluating
sum(binomial(1, n), n, 0, oo)
runs
from sage.calculus.calculus import symbolic_sum symbolic_sum(binomial(1, n), n, 0, oo)
which calls
maxima_calculus.sr_sum(binomial(1, n), n, 0, oo)
which runs
from sage.interfaces.maxima_lib import max_to_sr, maxima_eval, max_ratsimp, max_simplify_sum, max_sum, sr_to_max args = [binomial(1, n), n, 0, oo] max_to_sr(maxima_eval([[max_ratsimp], [[max_simplify_sum], ([max_sum], [sr_to_max(SR(a)) for a in args])]]))
Indeed we can see the bug in Maxima's simplify_sum
:
(%i1) load("simplify_sum"); (%i2) simplify_sum(sum(binomial(1,n),n,0,inf)); (%o2) 3
This was reported upstream as
and Robert Dodier committed a fix in Maxima in Oct 2019.
Change History (11)
comment:1 Changed 3 years ago by
 Milestone changed from sage8.7 to sage8.8
comment:2 Changed 2 years ago by
maxima5.43.0: simplify_sum still has bug
comment:3 Changed 2 years ago by
 Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.
Bug has a couple possible fixes upstream but apparently no commit yet.
comment:4 Changed 2 years ago by
 Milestone sage8.8 deleted
As the Sage8.8 release milestone is pending, we should delete the sage8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage8.9).
comment:5 Changed 15 months ago by
 Description modified (diff)
comment:6 Changed 4 months ago by
 Cc slelievre added
 Component changed from interfaces to symbolics
 Description modified (diff)
 Milestone set to sage9.4
 Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.
 Summary changed from sum(binomial(1,n),n,0,oo) should be 2 instead of 3 (error due to maxima) to Add doctest that sum(binomial(1, n), n, 0, oo) equals 2
This is now fixed in Maxima, in a version we use in Sage.
The only thing missing to close this ticket is a doctest.
comment:7 Changed 2 months ago by
 Milestone changed from sage9.4 to sage9.5
comment:8 Changed 4 weeks ago by
 Branch set to u/chapoton/27092
 Commit set to a2cd2eeb74c60223d6e86b44f580d27874c4c6a2
 Status changed from new to needs_review
comment:9 Changed 4 weeks ago by
 Commit changed from a2cd2eeb74c60223d6e86b44f580d27874c4c6a2 to 1cbe5bb59008986f08eafbd541ffd7ee258c8d26
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
1cbe5bb  adding a doctest for sum()

comment:10 Changed 4 weeks ago by
 Description modified (diff)
 Reviewers set to Samuel Lelièvre
 Status changed from needs_review to positive_review
En avant.
comment:11 Changed 3 weeks ago by
 Branch changed from u/chapoton/27092 to 1cbe5bb59008986f08eafbd541ffd7ee258c8d26
 Resolution set to fixed
 Status changed from positive_review to closed
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)