As reported on Ask SageMath and traced back to Maxima:
(%i1) load("simplify_sum"); (%i2) simplify_sum(sum(binomial(1,n),n,0,inf)); (%o2) 3
This contradicts reality and Maxima itself:
(%i3) create_list(binomial(1,n), n, [0,1,2,3,4,5,6]); (%o3) [1, 1, 0, 0, 0, 0, 0]
Confirmed with Maxima 5.42.0.
After
load(simplify_sum)
, I can sayverbose_level:2
to get some debugging outputs, which suggests the problem is into_hypergeometric
.I tried to
trace(to_hypergeometric, to_hypergeometric1)
to get some more info, but I haven't been able to figure out what's going on yet.I am guessing that
to_hypergeometric
is making a divide and conquer approach around line 758. It appears to me that the summation limits are incorrect in the sense that-min_ni
is counted twice. After applying this patch:I get the expected result (namely 2).
Running
batch(rtest_simplify_sum, test)
yields one error, problem 57, which is listed as an expected error in share/share_testsuite.lisp, so this patch doesn't introduce any new errors.I guess that the change could be made to either the first or second term in line 758. I changed the first term. If the second is changed,
-min_ni
would be changed to-min_ni + 1
. I didn't try that. I don't know if there's reason to favor one or the other.Thanks Robert! Looks like you found the source and a fix.
I don't know if it matters much which term is changed. Maybe at least a comment could be added to indicate explicitly that a choice has been made.
It would be good to have this fix committed; then both this ticket and the SageMath ticket downstream can be closed (as soon as Sage's Maxima is updated).
Can the one-line fix be commited?
Fixed by commit 0e34c4b, closing this report.