7
$\begingroup$

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}]

gives the incorrect answer

2 (-1 + Log[4])

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

Why?

$\endgroup$
6
  • $\begingroup$ 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. $\endgroup$
    – march
    Jan 28, 2016 at 21:22
  • 2
    $\begingroup$ Possibly related to this. Definitely similar. $\endgroup$ Jan 28, 2016 at 21:28
  • 1
    $\begingroup$ "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. $\endgroup$ Jan 28, 2016 at 21:58
  • $\begingroup$ @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. $\endgroup$
    – bbgodfrey
    Jan 29, 2016 at 5:51
  • $\begingroup$ @DanielLichtblau Thank you very much. I guess the bug has been already reported. $\endgroup$ Jan 29, 2016 at 9:56

3 Answers 3

2
$\begingroup$

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[4]) // N
(* 0.772589 *)

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

$\endgroup$
2
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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[139]= 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[142]= 2 - 2 Log[2] *)

(* Out[143]= 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)}$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.