SumConvergence[((-1)^n)/(Sqrt[n] + (-1)^n), n] returns True in Version 10.2?

Bug persisting through 10.4.1

I claim that the series $\sum_{n=2}^{\infty}\frac{(-1)^n}{\sqrt{n}+(-1)^n}$ diverges. To see this, rewrite the $n^{th}$ term as follows: \begin{equation*} \frac{(-1)^n}{\sqrt{n}+(-1)^n} = \frac{(-1)^n}{\sqrt{n}+(-1)^n} \times \frac{\sqrt{n}+(-1)^{n+1}}{\sqrt{n}+(-1)^{n+1}} \end{equation*} \begin{equation*} = \frac{(-1)^n\sqrt{n}+(-1)^{2n+1}}{n+(-1)^{2n+1}} = \frac{(-1)^n\sqrt{n}}{n-1} + \frac{-1}{n-1} \end{equation*} Thus, \begin{equation*} \sum_{n=2}^{\infty}\frac{(-1)^n}{\sqrt{n}+(-1)^n} = \sum_{n=2}^{\infty}\frac{(-1)^n\sqrt{n}}{n-1} - \sum_{n=1}^{\infty}\frac{1}{n} \end{equation*} Now, we have the difference of two series. The first series, by the Alternating Series Test, is convergent, and the second is the well known divergent harmonic series.

However,

    SumConvergence[((-1)^n)/(Sqrt[n] + (-1)^n), n]


returns True, and

    N[Sum[((-1)^n)/(Sqrt[n] + (-1)^n), {n, 2, Infinity}]]


returns -2.70244.

To add some evidence for the divergence of the series, the code

    pow10 = 10;
expo = 1;
While[ expo <= 6,
Print [N[Sum[((-1)^n)/(Sqrt[n] + (-1)^n), {n, 2, pow10}]]];
expo++;
pow10 *= 10;
]


returns

    -1.74377
-4.21214
-6.55378
-8.86764
-11.1737
-13.4774


I see in another post that there was an issue with SumConvergence in version 10.0.0.0, but I am using Version 10.2. Any insights here?

• I believe you are right. I note that NSum using the AlternatingSigns method yields a slightly different result as the one above for Sum: NSum[((-1)^n)/(Sqrt[n] + (-1)^n), {n, 2, Infinity}, Method -> "AlternatingSigns"] ==> -2.67892. Sum with a finite limit yields the same set of results as your loop does. Mar 17, 2016 at 20:20
• But if a sum is conditionally convergent (which if that sum converges, it will be conditionally convergent), if you rearrange the sum, you can get a different value for the limit (and you can rearrange it to get infinity), so rearranging it and getting infinity is not evidence for that sum not converging. Mar 17, 2016 at 20:39
• In fact, maybe I'm thinking about this wrong, but doesn't this sum also converge by the Alternating Series Test? Maybe it's the decreasing monotonically part that's missing... Mar 18, 2016 at 6:49
• @march It is missing that. Without rearranging, but just grouping the elements of the series pairwise we find a[2n]+a[2n+1] to be negative for all natural n, the partial sums very quickly get below -2.67892, and the positive element of the pair of two neighboring elements is never sufficient to bring it even close to the supposed limit. Mar 18, 2016 at 9:16
• It now returns unevaluated in MMA 11.0.0. Aug 13, 2016 at 2:45

Another way to rewrite the series:

Sum[((-1)^n)/(Sqrt[n] + (-1)^n), {n, 2, 1001}] ==
Sum[1/(Sqrt[2 n] + 1) - 1/(Sqrt[2 n + 1] - 1), {n, 1, 500}]

True

SumConvergence[((-1)^n)/(Sqrt[n] + (-1)^n), n]

True

SumConvergence[1/(Sqrt[2 n] + 1) - 1/(Sqrt[2 n + 1] - 1), n]

False


( v 10.1 )

This is not rearranging terms, but grouping in pairs; the series are the same:

• So, I assume you conclude that we see a bug here? Mar 17, 2016 at 20:56
• Rearranging terms is a big no-no for infinite sums though. Like @march said, the series might be conditionally convergent, although the OP is rather convincing. Mar 17, 2016 at 21:04
• beyond my expertise to prove or disprove (at least in a few minutes). I concur the OP's argument looks convincing. Mar 17, 2016 at 21:20
• @Sjoerd C. de Vries I would conclude that there is a bug here. By the way, this is a problem from Tom Apostol's excellent, but nowadays out of favor (due to it's rigor) "Calculus, 2e". The answer for the problem is "divergent." Mar 18, 2016 at 13:17
• Let the partial sum be p[n_]:= Sum[1/( 1 + (-1)^k Sqrt[k]), {k,2,n}]. Then we find numerically that Sqrt[ Log[n] ] > | p[n] | > Log[n] from n>n0 where n0 is some value about 20 or so. So the series is divergent. Mar 20, 2016 at 16:07

Wow. Just wow. So slightly different $$\sum_{n=2}^{\infty} \dfrac{(-1)^n}{n+(-1)^n}$$ is a classic example of (conditionally) convergent series for which Leibniz test fails. Leibniz test's monotonicity is NOT a necessary condition, thus the test itself is only sufficient, but not necessary! This is a very important result, because the test includes main nessessary condition for all series!

As for your variant of this series... It is also an example. See (diverges by Tailor): https://math.stackexchange.com/a/4221590 It is actually a bad idea to use something like this (but it is correct, sum of divergent and convergent series is always divergent) since if it is conditionally convergent you can always rearrange the terms to make it divergent (Riemann theorem) and thus sometimes vice versa is possible. So... Use Tailor instead and it is divergent, yes: https://math.stackexchange.com/a/2423137

There are other examples of such series with now absolute convergence. https://math.stackexchange.com/a/1073294/756502

I am not surprised Mathematica fails with these. They should really be remembered. Even this fails, but on Alpha it works:

a[n_] := ((-1)^n)/(n + (-1)^n);
SumConvergence[a[n], n]

• Two additional links are Absolute convergence and Riemann series theorem . Dec 7, 2021 at 6:25
• BTW, Alpha is also really buggy: it can print two different results (one being complex on first run) when you go to and F5 wolframalpha.com/input/… while it only prints complex for wolframalpha.com/input/… Dec 7, 2021 at 11:30
• Look at DiscretePlot[Sum[(-1)^n/((-1)^n + Sqrt[n]), {n, 2, k}], {k, 500, 530}] and DiscretePlot[Sum[(-1)^n/((-1)^n + Sqrt[n]), {n, 2, k}], {k, 5000, 5030}] Jul 2 at 13:50
• What about those? BTW, first link two comments above no longer prints strange stuff after F5, but second is still printing complex result. -4.92268 - 8.54584×10^-14 I Jul 2 at 20:51