I want to find the closed form of:
$\displaystyle \tag*{} \sum \limits _{n=1}^{\infty}\frac{(-1)^n (H_{2n}-H_{n})}{n(2)^n \binom{2n}{n}}$
Where $H_{k}$ is $k^{\text{th}}$ harmonic number
Can anyone tell me the value of the sum using Mathematica?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityI want to find the closed form of:
$\displaystyle \tag*{} \sum \limits _{n=1}^{\infty}\frac{(-1)^n (H_{2n}-H_{n})}{n(2)^n \binom{2n}{n}}$
Where $H_{k}$ is $k^{\text{th}}$ harmonic number
Can anyone tell me the value of the sum using Mathematica?
Clear["Global`*"]
f[n_] := (-1)^
n (HarmonicNumber[2 n] - HarmonicNumber[n])/(n*2^n*Binomial[2 n, n])
The terms of the sum converge to zero rapidly
DiscretePlot[Abs[f[n]], {n, 1, 25},
ScalingFunctions -> "Log"]
The partial sums are
(tab = Join[
{{nmax, TraditionalForm@Inactive[Sum][f[n], {n, 1, nmax}]}},
Table[{nmax, Sum[f[n], {n, 1, nmax}]}, {nmax, 1, 28}] /.
r_Rational :> N[r, 25]]) //
Grid[#, Frame -> All] &
The partial sum expressed as a DifferenceRoot
is
psum[nmax_] = Sum[f[n], {n, 1, nmax}]
Using AskConstants
to identify a constant with this approximate numeric value
(sum = (Log[2]^2 - Pi^2/12)/3) // TraditionalForm
Checking,
Block[{$MaxExtraPrecision = 500},
Join[
{{nmax, TraditionalForm[sum - Inactive[Sum][f[n], {n, 1, nmax}]]}},
Table[{nmax, N[sum - Sum[f[n], {n, 1, nmax}], nmax + 20] // N},
{nmax, 20, 200, 20}]] // Grid[#, Frame -> All] &]
EDIT: An alternate approach
(sum2 = FullSimplify@
Total[Sum[#, {n, 1, Infinity}] & /@
Assuming[n ∈ PositiveIntegers,
(List @@ (f[n] // FunctionExpand // Simplify //
Expand))]]) // TraditionalForm
N[sum2, 20]
(* -0.11400467316863726452 *)
Checking that sum
and sum2
are equivalent
Block[{$MaxExtraPrecision = 500},
N[sum - sum2, 200]]
(* N::meprec: Internal precision limit $MaxExtraPrecision = 500.` reached while evaluating 1/3 (-(π^2/12)+Log[2]^2)+1/72 (7 π^2-3 (9 Log[<<1>>]^2+8 PolyLog[2,Power[<<2>>]]-8 PolyLog[2,Times[<<2>>]])). *)
(* 0.*10^-699 *)
AskConstants
so many thanks for demonstrating its use
$\endgroup$
f[n_] := (((-1)^n (HarmonicNumber[2 n] - HarmonicNumber[n]))/(
n 2^n Binomial[2 n, n]))
First, we check the sum convergence
SumConvergence[f[n], n]
Doing the sum analytically:
Sum[f[n], {n, 1, Infinity}]
that takes too long for the time I can spare. So, let's do a couple of values and take it from there.
Table[Sum[f[n], {n, 1, xx}], {xx, 1, 21}]
You can try to find an analytic formula for the numerator and denominator of the above data, either by using FindSequenceFunction
or OEIS
. Neither leads to an answer.
So, finally we resort to numerics
Table[Sum[f[n], {n, 1, xx}], {xx, 1, 21}] // N
and we see that it quickly converges to -0.114005
Let $$a_n=\frac{ H_{2n}-H_{n}}{n\,2^n\, \binom{2n}{n}}\implies \frac{a_{n+1}}{a_n}=\frac{n \left(H_{n+1}-H_{2 n+2}\right)}{4 (2 n+1) \left(H_n-H_{2 n}\right)}$$ Using asymptotics $$\frac{a_{n+1}}{a_n}=\frac{1}{8}-\frac{1}{16 n}+\frac{1+\log (2)}{32 n^2 \log (2)}+O\left(\frac{1}{n^3}\right)$$ So, we can expect a quite fast convergence.
Facing an alternating series,
$$\sum_{n=1}^\infty (-1)^n a_n=\sum_{n=1}^p (-1)^n a_n+\sum_{n=p+1}^\infty (-1)^n a_n$$ consider $a_{p+1}$ $$H_{2(p+1)}-H_{p+1}=\log (2)-\frac{1}{4 n}+\frac{5}{16 n^2}-\frac{3}{8 n^3}+O\left(\frac{1}{n^4}\right)$$
$$\log\big[H_{2(p+1)}-H_{p+1}\big]=\log (\log (2))-\frac{1}{4p \log (2)}+\frac{10 \log (2)-1}{32 p^2 \log ^2(2)}+O\left(\frac{1}{p^3}\right)$$ $$\log\Bigg[2^{p+1} (p+1) \binom{2 p+2}{p+1}\Bigg]=3p \log (2)+\frac{1}{2} \log \left(\frac{64 p}{\pi }\right)+\frac{3}{8 p}-\frac{1}{8 p^2}+O\left(\frac{1}{p^3}\right)$$
$$\log(a_{p+1})=-3p \log (2)+\left(\log (\log (2))-\frac{1}{2} \log \left(\frac{64 p}{\pi }\right)\right)+O\left(\frac{1}{p}\right)$$ So, if we want $$a_{p+1} \leq \epsilon \quad \implies \quad p \geq \frac{W(t)}{6 \log (2)} \qquad \text{where} \qquad t=\frac{3 \pi \log ^3(2)}{32 \epsilon ^2}$$ $W(t)$ being Lambert function.
Suppose $\epsilon=10^{-16}$, this gives as a real $p=16.1471$ (notice that the exact solution is $16.1263$.
Computing for $p=17$ gives for the summation $$-\frac{6773770929644673431621962072907}{59416607594890592064865566720000}$$ which, in decimal, is $-0.11400467316863727867$.
Now,being lazy, I went here; click the last button ("Integer Relation Algorithms") and you will see the result already given