# incorrect exact sum of a series

Bug introduced in 9.0 or earlier and fixed in 10.4

Sum[(-1)^m*(1/Binomial[2*m + 2, 2] + 1/Binomial[2*m + 3, 2]), {m, 0, Infinity}]


gives the right value

-2 + π


but the same sum

Sum[(-1)^Floor[n/2]/Binomial[n + 2, 2], {n, 0, Infinity}]


2 (-1 + Log)


although all corresponding partial sums are equal and the series is absolutely convergent!

Why?

• What do you mean, all corresponding partial sums are equal? It doesn't look to me like that's true (upon plotting these as a function of the upper limit on the sum. – march Jan 28 '16 at 21:22
• Possibly related to this. Definitely similar. – Daniel Lichtblau Jan 28 '16 at 21:28
• "All corresponding partial sums are equal" means that, for any explicit positive integer M, the first sum for m=0 to M-1 has the same value as the second for n=0 to 2M-1. – Grégoire Nicollier Jan 28 '16 at 21:58
• @GrégoireNicollier I encourage you to submit this issue to Wolfram, Inc. After a day or so has passed, you also may wish to add the "bug" tag. – bbgodfrey Jan 29 '16 at 5:51
• @DanielLichtblau Thank you very much. I guess the bug has been already reported. – Grégoire Nicollier Jan 29 '16 at 9:56

I agree that this appears to be a bug. Indeed, the partial sums described by the OP in a comment are the same. For instance

Table[Sum[(-1)^ m*(1/Binomial[2*m + 2, 2] + 1/Binomial[2*m + 3, 2]), {m, 0, mm}],
{mm, 0, 20}] ==
Table[Sum[(-1)^Floor[n/2]/Binomial[n + 2, 2], {n, 0, nn}], {nn, 1, 41, 2}]
(* True *)


This is because sums of pairs of terms in the second Sum equal individual terms in the first Sum, as is evident by examining the expressions themselves as well as by adding the terms numerically.

Table[(-1)^m*(1/Binomial[2*m + 2, 2] + 1/Binomial[2*m + 3, 2]), {m, 0, 9}]
(* {4/3, -(4/15), 4/35, -(4/63), 4/99, -(4/143), 4/195, -(4/255), 4/323, -(4/399)} *)

Table[(-1)^Floor[n/2]/Binomial[n + 2, 2], {n, 0, 19}]
Total[#] & /@ Partition[%, 2]
(* {4/3, -(4/15), 4/35, -(4/63), 4/99, -(4/143), 4/195, -(4/255), 4/323, -(4/399)} *)


The sums indeed are converging to -2 + π

(-2 + π) // N
(* 1.14159 *)
Sum[(-1)^m*(1/Binomial[2*m + 2, 2] + 1/Binomial[2*m + 3, 2]), {m, 0, 1000}] // N
(* 1.14159 *)
Sum[(-1)^Floor[n/2]/Binomial[n + 2, 2], {n, 0, 2001}] // N
(* 1.14159 *)


which is distinctly different from

2 (-1 + Log) // N
(* 0.772589 *)


Addendum: These computations were performed with version 10.3. The same problem occurs in version 9.0.

The answer returned by Sum for the example with Floor is certainly incorrect.

Sum attempts to evaluate this example by reducing the input to an expression without Floor. The bug occurs due to a problematic variable localization while trying to evaluate the resulting rational-exponential sum.

Sorry for the confusion caused by this problem.

Here's a related example of this bug:

Replacing Floor by Ceiling we get the sum

Sum[(-1)^Ceiling[n/2]/Binomial[n + 2, 2], {n, 0, \[Infinity]}]

(* Out= 0 *)


which is returned as 0 whereas the correct value is

Sum[(-1)^Ceiling[n/2] x^n/Binomial[n + 2, 2], {n, 0, \[Infinity]}] /. x -> 1
% // N

(* Out= 2 - 2 Log *)

(* Out= 0.613706 *)


Furthermore, the sums starting from 1 are returned unevaluated

Sum[(-1)^Floor[n/2]/Binomial[n + 2, 2], {n, 1, \[Infinity]}]


$$\sum _{n=1}^{\infty } \frac{2 (-1)^{\left\lfloor \frac{n}{2}\right\rfloor }}{(n+1) (n+2)}$$

Sum[(-1)^Ceiling[n/2]/Binomial[n + 2, 2], {n, 1, \[Infinity]}]


$$\sum _{n=1}^{\infty } \frac{2 (-1)^{\left\lceil \frac{n}{2}\right\rceil }}{(n+1) (n+2)}$$