9
$\begingroup$

Take this sum for example: $$\sum_{n=2}^\infty\frac1{\log(n!)}$$ Wolfram says that this does not converge by the comparison test. However, when I use Mathematica's NSum function, it returns a numerical value for the summation. Who should I trust?

NSum[1/Log[n!], {n, 2, \[Infinity]}]=6.12902
$\endgroup$
9
  • 3
    $\begingroup$ Stirling: $\log n!\sim n\log n$, and $\frac{1}{n\log n}$ is not summable. $\endgroup$ Commented Nov 3, 2018 at 3:35
  • $\begingroup$ @AccidentalFourierTransform by not summable, do you mean divergent? $\endgroup$
    – John Glenn
    Commented Nov 3, 2018 at 3:36
  • 4
    $\begingroup$ You should have mentioned that Mathematica throws error messages when executing NSum[1/Log[n!], {n, 2, \[Infinity]}]... $\endgroup$ Commented Nov 3, 2018 at 7:05
  • 4
    $\begingroup$ From the doc page for NSum under the section Possible Issues: "NSum may not detect divergence for some infinite sums" and "Convergence verification is based on a ratio test that is inconclusive when equal to 1", both of which apply here. $\endgroup$
    – Michael E2
    Commented Nov 3, 2018 at 13:55
  • 1
    $\begingroup$ I made test PHP script which evaluates numerically this series. My results are n=23,166,000,000; sum=6.2010890765879; term_n=1.8878160302708E-12. So clearly a bigger value than mathematica's 6.12902, but it's not surprising, because series converges very slowly and mathematica doesn't have a patience :-) $\endgroup$ Commented Nov 6, 2018 at 14:10

2 Answers 2

15
$\begingroup$

When a command has issues, it is a good idea to check the Possible Issues section of the doc page for the command, in this case NSum. Two of the issues apply to the OP's case:

NSum may not detect divergence for some infinite sums

Convergence verification is based on a ratio test that is inconclusive when equal to 1

[Edit notice: I made a mistake in the integral test which I've deleted.]

$\endgroup$
16
$\begingroup$

enter image description here As the message shows, NSum works on limited recursions. Mathematica does not consider the "mathematical converge" when it works on NSum. Therefore Mathematica finds that this sum converges too slowly, and threw out the answer after MaxRecursion.

$\endgroup$

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