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?

  • 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
    Feb 28 at 18:51
  • 1
    $\begingroup$ Are you sure about the right numerical value? Because I find $40.66752074791188\ldots$ $\endgroup$
    – Roman
    Feb 28 at 18:59
  • 1
    $\begingroup$ I get the same as @Roman $\endgroup$
    – Michael E2
    Feb 28 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$ Feb 28 at 19:15
  • $\begingroup$ @Michael E2 Thank you Michael. Whats the command you used and gave you 40.66...? $\endgroup$ Feb 28 at 19:27

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  *)
  • $\begingroup$ Amazing. thank you very much.+1 $\endgroup$ Feb 28 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$ Feb 28 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
    Feb 28 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$ Mar 1 at 4:14
  • $\begingroup$ @AliShadhar Oops, *Series[expr, {n, Infinity, order}], not Sum[...]. :) $\endgroup$
    – Michael E2
    Mar 1 at 17:13

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


  • $\begingroup$ Beautiful command. thank you .+1 $\endgroup$ Feb 28 at 20:37
  • 2
    $\begingroup$ BTW, the error can be estimated here. The one is of order $20^{-18}$ at first sight. $\endgroup$
    – user64494
    Feb 28 at 21:08
  • $\begingroup$ Can you give more digits for approximation ? $\endgroup$ Mar 1 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
    Mar 1 at 7:42

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.