5
$\begingroup$

The right numerical value of the closed form of $\sum_{n=1}^\infty\frac{4^n H_n^2}{{2n\choose n}n^2}$ is $40.66752074791188333...$.

I tried to verify this result on Mathematica using the command:

NSum[4^n HarmonicNumber[n]^2/(Binomial[2 n, n] n^2), {n, 1, Infinity},
     WorkingPrecision -> 8]

but it failed to give any approximation, so I replaced Infinity by 1000 000 and it gave 39.70 which is close to the numeric value of the closed form. My question is: why Mathemtica fails to give the right approximation for series involving the binomial series when we use Infinity?. Other question is: is there another command besides

NSum[4^n HarmonicNumber[n]^2/(Binomial[2 n, n] n^2), {n, 1, 1000000}, 
     WorkingPrecision -> 8]

that gives a more accurate approximation?

$\endgroup$
6
  • 1
    $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful $\endgroup$
    – Michael E2
    Commented Feb 28, 2021 at 18:51
  • 1
    $\begingroup$ Are you sure about the right numerical value? Because I find $40.66752074791188\ldots$ $\endgroup$
    – Roman
    Commented Feb 28, 2021 at 18:59
  • 1
    $\begingroup$ I get the same as @Roman $\endgroup$
    – Michael E2
    Commented Feb 28, 2021 at 19:03
  • $\begingroup$ @Roman thank you. Yes the value you mentioned is the right one. I edited my post. I would like to know the command you used. $\endgroup$ Commented Feb 28, 2021 at 19:15
  • $\begingroup$ @Michael E2 Thank you Michael. Whats the command you used and gave you 40.66...? $\endgroup$ Commented Feb 28, 2021 at 19:27

2 Answers 2

7
$\begingroup$

The terms in the asymptotic expansion of the summand may be summed symbolically and thereby determine the major component of the desired sum. This helps NSum deal with the remainder. I'm not an expert on numerical summation, and I know neither why the sum is numerically difficult (other than convergence is very slow) nor what better methods/transformations might be applied (even if the method is not available in NSum). This approach worked, so I didn't go looking for other ways to accelerate convergence.

The majorsum converges very slowly toward the desired sum, but increasing the order improves the ability of NSum to deal with the remainder. Both Sum and NSum take a few seconds to run.

order = 12;
major = Normal@Series[
    4^n HarmonicNumber[n]^2/(Binomial[2 n, n] n^2),
    {n, Infinity, order}];
majorsum = Sum[major, {n, Infinity}];

majorsum + NSum[
  4^n HarmonicNumber[n]^2/(Binomial[2 n, n] n^2) - major,
  {n, 1, Infinity},
  NSumTerms -> 50, WorkingPrecision -> 50, Method -> "WynnEpsilon"]

(*  40.66752074791188333784746413477  *)
$\endgroup$
5
  • $\begingroup$ Amazing. thank you very much.+1 $\endgroup$ Commented Feb 28, 2021 at 20:14
  • $\begingroup$ whats order=12 and NSumTerms-> 50 stand for? and does 50 in NSumTerms and WorkingPrecision has to be the same? $\endgroup$ Commented Feb 28, 2021 at 20:20
  • $\begingroup$ They are described in the docs. Sum[expr, {n, Infinity, order}] gives a series of order order. The others are described in NSum. $\endgroup$
    – Michael E2
    Commented Feb 28, 2021 at 23:50
  • $\begingroup$ Thanks. By the way, I compared your command to approximate the zeta(6) with N[Zeta[6],100] and the error was zero. Interesting! $\endgroup$ Commented Mar 1, 2021 at 4:14
  • $\begingroup$ @AliShadhar Oops, *Series[expr, {n, Infinity, order}], not Sum[...]. :) $\endgroup$
    – Michael E2
    Commented Mar 1, 2021 at 17:13
3
$\begingroup$

Here is a somewhat different way. First, we approximate the summand for big n. Second, we exactlly summarize that approximated summand from 20 to Infinity. Third, we add the first 19 terms.

Normal[Series[4^n HarmonicNumber[n]^2/(Binomial[2 n, n]* n^2),{n, Infinity,20}]];
Sum[%, {n, 20, Infinity}];
N[%, 20] + Sum[4^n HarmonicNumber[n]^2/(Binomial[2 n, n] n^2), {n, 1, 19}]

40.667520747911883338

$\endgroup$
4
  • $\begingroup$ Beautiful command. thank you .+1 $\endgroup$ Commented Feb 28, 2021 at 20:37
  • 2
    $\begingroup$ BTW, the error can be estimated here. The one is of order $20^{-18}$ at first sight. $\endgroup$
    – user64494
    Commented Feb 28, 2021 at 21:08
  • $\begingroup$ Can you give more digits for approximation ? $\endgroup$ Commented Mar 1, 2021 at 0:40
  • $\begingroup$ @AliShadhar: Let us change the last two lines by Sum[%, {n, 25, Infinity}]; N[%, 42] + Sum[4^n HarmonicNumber[n]^2/(Binomial[2 n, n] n^2), {n, 1, 24}]. This produces 40.6675207479118833378474641375573196174775. In most cases such precision is not needed. $\endgroup$
    – user64494
    Commented Mar 1, 2021 at 7:42

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