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
  • 3
    $\begingroup$ Stirling: $\log n!\sim n\log n$, and $\frac{1}{n\log n}$ is not summable. $\endgroup$ – AccidentalFourierTransform Nov 3 '18 at 3:35
  • $\begingroup$ @AccidentalFourierTransform by not summable, do you mean divergent? $\endgroup$ – John Glenn Nov 3 '18 at 3:36
  • 4
    $\begingroup$ You should have mentioned that Mathematica throws error messages when executing NSum[1/Log[n!], {n, 2, \[Infinity]}]... $\endgroup$ – Henrik Schumacher Nov 3 '18 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 Nov 3 '18 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$ – Agnius Vasiliauskas Nov 6 '18 at 14:10

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.]


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.

|improve this answer|||||

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