# Converges or diverges?

Studying the behavior of the series $$\sum _{n=1}^{\infty } \left(1-\frac{\log (n)}{n}\right)^{2 n}$$, I try in 12.3.1 on Windows 10

SumConvergence[(1 - Log[n]/n)^(2 n), n]


False

, but

SumConvergence[(1 - Log[n]/n)^(2 n), n, Method -> "RaabeTest"]


True

The result of

NSum[(1 - Log[n]/n)^(2 n), {n, 1, Infinity}]


1.33193*10^244

confirms the divergence and the results of

NSum[(1 - Log[n]/n)^(2 n), {n, 1, Infinity}, WorkingPrecision -> 30]


1.407104427435176587354

and

Series[(1 - Log[n]/n)^(2 n), {n, Infinity, 3}]


(1/n)^2-Log[n]^2/n^3+O(1/n)^4

stand for the convergence.

What should I trust?

• The option Method->"IntegralTest" should correctly work here in view of AsymptoticEqual[(1 - Log[n]/n)^(2 n), 1/n^2, n -> Infinity] which answers True, but fails. Nov 2, 2021 at 8:55
• You can just plot the sum-terms with increasing n and see that the curve goes to zero. Dec 7, 2021 at 11:15
• I added a new sequence to the OEIS, see oeis.org/A354450. To calculate the more accurate value of this sum, it was more appropriate to use Maple instead of Mathematica. Series[(1 - Log[n]/n)^(2*n), {n, Infinity, 30}] is for many hours. In Maple, the expansion of 100 terms is done almost immediately. May 30 at 14:35

Do the Raabe test by hand:

b[n_] = (1 - Log[n]/n)^(2 n);

Limit[n (b[n]/b[n + 1] - 1), n -> Infinity]
(* 2 *)


converges.

• You incorrectly apply the Raabe's test (see Wiki for info). You wrote "If the Raabe test gives a result >1 it indicates that the series diverges" which is not true. Nov 2, 2021 at 8:51
• You are right, it is the other way round. >1 means convergence. I corrected my answer. Nov 2, 2021 at 10:02

This looks like a horrible bug present in 12.3.1 (still happens on 13.0.1) (indeed due to "SumConvergence uses pre V11.2 Limit" and it is used for DivergenceTest). First of all even if on this limit Raabe test Method does work there is worse example here: Why doesn't Mathematica provide an answer while Wolfram|Alpha does, concerning a series convergence? I suppose DivergenceTest has higher priority (remember it is only meaningful for False, for True it means nothing). Or the problem there is that Raabe is done on nonnegative series and it somehow fails to check it. So:

a[n_] := (1 - Log[n]/n)^(2 n);
SumConvergence[a[n], n, Method -> Automatic] (* False, bug: does not TRY Raabe *)
SumConvergence[a[n], n, Method -> "RaabeTest"] (* True, NICE. It is 2. *)
SumConvergence[a[n], n, Method -> "RatioTest"] (* Error *)
SumConvergence[a[n], n, Method -> "RootTest"] (* Error *)
SumConvergence[a[n], n, Method -> "DivergenceTest"] (* False, a bug! *)
SumConvergence[a[n], n, Method -> "IntegralTest"] (* Fails, infinite loop  bug!! *)


For DivergenceTest see https://mathematica.stackexchange.com/a/163389/82985 Now, they broke IntegralTest long time ago, see SumConvergence difficulty first workaround on 1- Cos[Pi/n] there does not help this case though, it errors out after some time but FreeQ idea and myLCT do work, WOW. FreeQ does not work on (1 - Log[n]/n)^(2 n) though by myLCT does. So...

Now, indeed both Raabe test by hand and next level of it (in the series of Kummer's tests), Bertrand test (strange it is not one of Methods, WTF, one can even use Extended Betrand that is continuation further of that):

b[n_] = (1 - Log[n]/n)^(2 n);

Limit[Log[n] (n (b[n]/b[n + 1] - 1) - 1), n -> Infinity] (* prints Infinity, so convergent *)


Other example is worse. It is actually quite interesting, see: https://math.stackexchange.com/questions/2830362/sum-limitsn-1-infty1-cos-frac-pin-convergence-proof?noredirect=1&lq=1 and related questions.

a[n_] := 1 - Cos[Pi/n];
SumConvergence[a[n], n, Method -> Automatic] (* error *)
SumConvergence[a[n], n, Method -> "RaabeTest"] (* error *)
SumConvergence[a[n], n, Method -> "RatioTest"] (* error *)
SumConvergence[a[n], n, Method -> "RootTest"] (* error *)
SumConvergence[a[n], n, Method -> "DivergenceTest"] (* true, so useless *)
SumConvergence[a[n], n, Method -> "IntegralTest"] (* error *)


Raabe by hand again prints 2 while Betrand's prints Infinity. So converges.

b[n_] = 1 - Cos[Pi/n];

Limit[Log[n] (n (b[n]/b[n + 1] - 1) - 1), n -> Infinity] (* Infinity *)


Now I would not say this Raabe approach is always perfect. Try:

b[n_] = Abs[Sin[n]]^n/n;

Limit[n (b[n]/b[n + 1] - 1), n -> Infinity] (* Infinite loop *)

• +1. Many thanks from me to you for your investigation. Nov 30, 2021 at 15:25
• I think that it somehow fails to see it is positive sequence, since that is a requirement for Raabe test. Since some n of course. I mean you cannot get anything after that wrong and it does work by hand. Nov 30, 2021 at 15:30
• As I understand it, the comparison test is out of scope of SumConvergence. Nov 30, 2021 at 15:31
• Raabe, Bertrand and Dalamber all require positive terms. It fails to check that on 1 - Cos[Pi/n], I suppose. Nov 30, 2021 at 15:34
• Also myLCT only works for IntegralTest for (1 - Log[n]/n)^(2 n), FreeQ example does not work (and loops for a long time too). Nov 30, 2021 at 15:45

SumConvergence uses pre V11.2 Limit, which evaluates to the wrong answer below. This makes SumConvergence think the summand fails the divergence test and hence returns False.

Compare:

AsymptoticsClassicLimit[(1 - Log[n]/n)^(2 n), n -> ∞, Assumptions -> n ∈ Integers]

1

Limit[(1 - Log[n]/n)^(2 n), n -> ∞, Assumptions -> n ∈ Integers]

0


Swapping definitions fixes the issue:

Block[{AsymptoticsClassicLimit = Limit},
SumConvergence[u[n], n]
]

True

• Can you kindly elaborate your post to make it understandable? TIA. Dec 6, 2021 at 14:02
• The condition $\lim_{n\to\infty}a_n=0$ is only a necessary condition for the convergence of a series. There are both convergent series and divergent series which satisfy it. Dec 6, 2021 at 14:58
• ‘SumConvergence’ uses that ‘ClassicLimit’ function instead of ‘Limit’. ‘ClassicLimit’ is returning 1 for that limit and so ‘SumConvergence’ thinks the sum is divergent. Forcing ‘SumConvergence’ to use ‘Limit’ instead of ‘ClassicLimit’ fixes this issue. Dec 6, 2021 at 15:33
• Thank you. BTW, Asymptotics  ClassicLimit[(1 - Log[n]/n)^(2 n), n -> [Infinity]] returns 0. Indeed, the documentation says SumConvergence was not updated since 2010. Dec 6, 2021 at 16:05
• Do you have any idea what causes RaabeTest to fail for 1 - Cos[Pi/n]? Limit hack does not work there. I think it cannot confirm it is positive sequence, since that is needed for Raabe. Dec 7, 2021 at 11:44

Not a real answer, but rather a recommendation to ask a mathematician in this case (e.g., at https://math.stackexchange.com/). Mathematica does not seem to provide a definite answer. In the methods you have several options

a[n_] := (1 - Log[n]/n)^(2 n)
SumConvergence[a[n], n, Method -> Automatic]
SumConvergence[a[n], n, Method -> "RaabeTest"]
SumConvergence[a[n], n, Method -> "RatioTest"]
SumConvergence[a[n], n, Method -> "RootTest"]


False

True

I suppose the answers depend on the considered test. RatioTest and RootTest return nothing. Manual investigation of the ratio and root test yields

temp = FullSimplify[Abs[a[n + 1]/a[n]], n > 0];
Limit[temp, n -> Infinity]
temp = FullSimplify[Abs[a[n]]^(1/n), n > 0];
Limit[temp, n -> Infinity]


1

1

meaning that both of these test can NOT give an answer, see, e.g., Wikipedia. Try asking in https://math.stackexchange.com/. This question could also be moved there.

• Disagree. This is a Mathematica question with the codes and results. Unfortunately, Mathematica produces some wrong results in this case without any warnings.. Thank you anyway for your personal opinion. Nov 2, 2021 at 8:21
• BTW, I don't find any post tugged by calculus-and-analysis in your profile. Nov 2, 2021 at 8:29
• You omitted Method->"IntegralTest" which should correctly work here, but fails, in your above direction. This does not make a good impression. Nov 2, 2021 at 8:33
• Also how about NSum`? Nov 2, 2021 at 8:40