12

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?

user64494
  • 26,149
  • 4
  • 27
  • 56
  • 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. – user64494 Nov 02 '21 at 08:55
  • You can just plot the sum-terms with increasing n and see that the curve goes to zero. – Rom38 Dec 07 '21 at 11:15
  • 1
    I added a new sequence to the OEIS, see https://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. – Vaclav Kotesovec May 30 '22 at 14:35

4 Answers4

8

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.

Daniel Huber
  • 51,463
  • 1
  • 23
  • 57
  • 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. – user64494 Nov 02 '21 at 08:51
  • You are right, it is the other way round. >1 means convergence. I corrected my answer. – Daniel Huber Nov 02 '21 at 10:02
6

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 *)

4

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:

Asymptotics`ClassicLimit[(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[{Asymptotics`ClassicLimit = Limit},
  SumConvergence[u[n], n]
]
True
Greg Hurst
  • 35,921
  • 1
  • 90
  • 136
  • Can you kindly elaborate your post to make it understandable? TIA. – user64494 Dec 06 '21 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. – user64494 Dec 06 '21 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. – Greg Hurst Dec 06 '21 at 15:33
  • Thank you. BTW, Asymptotics ClassicLimit[(1 - Log[n]/n)^(2 n), n -> \[Infinity]] returns0. Indeed, the documentation saysSumConvergence` was not updated since 2010. – user64494 Dec 06 '21 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 07 '21 at 11:44
  • Another example that this hack works on is Cos[n] x^n. It returns false... See https://mathematica.stackexchange.com/a/215363/82985 – Валерий Заподовников Dec 19 '21 at 04:41
  • Can we have a bug header for this and a separate bug for RaabeTest bug https://mathematica.stackexchange.com/q/224072/82985? – Валерий Заподовников May 28 '22 at 13:19
  • I would imagine so. Though I don't know the prerequisites to allow the tag. – Greg Hurst May 31 '22 at 23:13
  • BTW, you cannot use Assumptions on -> variable. It prints a warning even in 13.1 on Limit[(1 - Log[n]/n)^(2 n), n -> ∞, Assumptions -> n ∈ Integers]. That only works on ClassicLimit, but even then DiscreteLimit is better, but not always, see https://mathematica.stackexchange.com/a/261428/82985 – Валерий Заподовников Aug 24 '22 at 18:52
  • In 13.2 https://mathematica.stackexchange.com/a/261428/82985 is fixed, so you can now IMHO replace ClassicLimit with DiscreteLimit[(1 - Log[n]/n)^(2 n), n -> \[Infinity]] – Валерий Заподовников Apr 17 '23 at 07:58
2

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.

Mauricio Fernández
  • 5,463
  • 21
  • 45