12
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$
    – user64494
    Nov 2, 2021 at 8:55
  • $\begingroup$ You can just plot the sum-terms with increasing n and see that the curve goes to zero. $\endgroup$
    – Rom38
    Dec 7, 2021 at 11:15
  • $\begingroup$ 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. $\endgroup$ May 30 at 14:35

4 Answers 4

8
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – user64494
    Nov 2, 2021 at 8:51
  • $\begingroup$ You are right, it is the other way round. >1 means convergence. I corrected my answer. $\endgroup$ Nov 2, 2021 at 10:02
6
$\begingroup$

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 *)
$\endgroup$
11
  • 1
    $\begingroup$ +1. Many thanks from me to you for your investigation. $\endgroup$
    – user64494
    Nov 30, 2021 at 15:25
  • $\begingroup$ 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. $\endgroup$ Nov 30, 2021 at 15:30
  • $\begingroup$ As I understand it, the comparison test is out of scope of SumConvergence. $\endgroup$
    – user64494
    Nov 30, 2021 at 15:31
  • $\begingroup$ Raabe, Bertrand and Dalamber all require positive terms. It fails to check that on 1 - Cos[Pi/n], I suppose. $\endgroup$ Nov 30, 2021 at 15:34
  • $\begingroup$ 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). $\endgroup$ Nov 30, 2021 at 15:45
3
$\begingroup$

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
$\endgroup$
8
  • $\begingroup$ Can you kindly elaborate your post to make it understandable? TIA. $\endgroup$
    – user64494
    Dec 6, 2021 at 14:02
  • $\begingroup$ 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. $\endgroup$
    – user64494
    Dec 6, 2021 at 14:58
  • $\begingroup$ ‘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. $\endgroup$
    – Greg Hurst
    Dec 6, 2021 at 15:33
  • $\begingroup$ 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. $\endgroup$
    – user64494
    Dec 6, 2021 at 16:05
  • $\begingroup$ 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. $\endgroup$ Dec 7, 2021 at 11:44
2
$\begingroup$

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.

$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – user64494
    Nov 2, 2021 at 8:21
  • $\begingroup$ BTW, I don't find any post tugged by calculus-and-analysis in your profile. $\endgroup$
    – user64494
    Nov 2, 2021 at 8:29
  • $\begingroup$ You omitted Method->"IntegralTest" which should correctly work here, but fails, in your above direction. This does not make a good impression. $\endgroup$
    – user64494
    Nov 2, 2021 at 8:33
  • $\begingroup$ Also how about NSum? $\endgroup$
    – user64494
    Nov 2, 2021 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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