# Evaluate $\sum\limits_{n=0}^{\infty}(-1)^n\sum\limits_{j=0}^{k}{k \choose j}\frac{(-1)^j}{2n+2j+1}$

Evaluate $$g(k)$$ if $$\sum\limits_{n=0}^{\infty}(-1)^n\sum\limits_{j=0}^{k}{k \choose j}\frac{(-1)^j}{2n+2j+1}=\frac{\pi}{2^{2-k}}+g(k)$$.

The well-known Gregory Series,

$$\sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}=\frac{\pi}{4}\tag1$$

Let us generalize $$(1)$$ in terms of binomial coefficients $${k \choose j}$$,

Where $$k\ge0$$

$$\sum_{n=0}^{\infty}(-1)^n\sum_{j=0}^{k}{k \choose j}\frac{(-1)^j}{2n+2j+1}=\frac{\pi}{2^{2-k}}+g(k)\tag2$$

Expand $$(2)$$ for $$k=1,2$$ and $$3$$,

$$\sum_{n=0}^{\infty}(-1)^n\left(\frac{1}{2n+1}-\frac{1}{2n+3}\right)=\frac{\pi}{2}-1\tag3$$

$$\sum_{n=0}^{\infty}(-1)^n\left(\frac{1}{2n+1}-2\frac{1}{2n+3}+\frac{1}{2n+5}\right)=\pi-\frac{8}{3}\tag4$$

$$\sum_{n=0}^{\infty}(-1)^n\left(\frac{1}{2n+1}-\frac{3}{2n+3}+\frac{3}{2n+5}-\frac{1}{2n+5}\right)=2\pi-\frac{88}{15}\tag5$$

The pattern for $$g(k)$$ is not so obvious, I was not able to determine the closed form $$g(k)$$

Q: How can we find the closed form for $$(2)?$$

We will make use of the identity $$\sum_{k=0}^n(-1)^k\binom{n}{k}\frac1{k+\alpha}=\frac{n!\,\Gamma(\alpha)}{\Gamma(n+1+\alpha)}\tag1$$ which can be proven by induction on $$n$$.

The sum in the question is \begin{align} &\sum_{n=0}^\infty(-1)^n\sum_{j=0}^k\binom{k}{j}\frac{(-1)^j}{2n+2j+1}\tag2\\ &=\frac12\sum_{n=0}^\infty(-1)^n\sum_{j=0}^k\binom{k}{j}\frac{(-1)^j}{n+j+\frac12}\tag3\\ &=\frac12\sum_{n=0}^\infty(-1)^n\frac{k!\,\Gamma\!\left(n+\frac12\right)}{\Gamma\!\left(n+k+\frac32\right)}\tag4\\ &=\frac12\sum_{n=0}^\infty(-1)^n\int_0^1(1-t)^kt^{n-\frac12}\,\mathrm{d}t\tag5\\ &=\frac12\int_0^1\frac{(1-t)^k}{(1+t)\sqrt{t}}\,\mathrm{d}t\tag6\\ &=\int_0^1\frac{\left(1-t^2\right)^k}{1+t^2}\,\mathrm{d}t\tag7\\ &=\int_0^1\frac{\left(2-\left(1+t^2\right)\right)^k}{1+t^2}\,\mathrm{d}t\tag8\\ &=2^k\left(\frac\pi4+\sum_{j=1}^k\left(-\frac12\right)^j\binom{k}{j}\int_0^1\left(1+t^2\right)^{j-1}\,\mathrm{d}t\right)\tag9\\ &=2^k\left(\frac\pi4+\sum_{j=1}^k\left(-\frac12\right)^j\binom{k}{j}\sum_{i=0}^{j-1}\binom{j-1}{i}\frac1{2i+1}\right)\tag{10}\\ &=2^k\left(\frac\pi4-\frac12\sum_{j=0}^{k-1}\left(-\frac12\right)^j\sum_{m=1}^k\binom{k-m}{j}\sum_{i=0}^{j}\binom{j}{i}\frac1{2i+1}\right)\tag{11}\\ &=2^k\left(\frac\pi4-\frac12\sum_{m=1}^k\sum_{i=0}^{k-1}\sum_{j=i}^{k-m}\left(-\frac12\right)^j\binom{k-m}{i}\binom{k-m-i}{j-i}\frac1{2i+1}\right)\tag{12}\\ &=2^k\left(\frac\pi4-\frac12\sum_{m=1}^k\sum_{i=0}^{k-1}\sum_{j=0}^{k-m-i}\left(-\frac12\right)^{j+i}\binom{k-m}{i}\binom{k-m-i}{j}\frac1{2i+1}\right)\tag{13}\\ &=2^k\left(\frac\pi4-\frac12\sum_{m=1}^k\sum_{i=0}^{k-1}\left(-\frac12\right)^i\binom{k-m}{i}\left(\frac12\right)^{k-m-i}\frac1{2i+1}\right)\tag{14}\\ &=2^k\left(\frac\pi4-\frac14\sum_{m=1}^k\sum_{i=0}^{k-m}(-1)^i\binom{k-m}{i}\left(\frac12\right)^{k-m}\frac1{i+\frac12}\right)\tag{15}\\ &=2^k\left(\frac\pi4-\frac14\sum_{m=1}^k\left(\frac12\right)^{k-m}\frac{(k-m)!\,\Gamma\!\left(\frac12\right)}{\Gamma\!\left(k-m+\frac32\right)}\right)\tag{16}\\ &=2^k\left(\frac\pi4-\frac14\sum_{m=0}^{k-1}\left(\frac12\right)^m\frac{m!\,\Gamma\!\left(\frac12\right)}{\Gamma\!\left(m+\frac32\right)}\right)\tag{17}\\ &=2^k\left(\frac\pi4-\frac12\sum_{m=0}^{k-1}\frac{m!}{(2m+1)!!}\right)\tag{18}\\ \end{align} Explanation:
$$\phantom{1}(3)$$: bring $$\frac12$$ out front
$$\phantom{1}(4)$$: apply $$(1)$$
$$\phantom{1}(5)$$: apply the Beta Function
$$\phantom{1}(6)$$: sum in $$n$$
$$\phantom{1}(7)$$: substitute $$t\mapsto t^2$$
$$\phantom{1}(8)$$: $$1-t^2=2-\left(1+t^2\right)$$
$$\phantom{1}(9)$$: apply the Binomial Theorem
$$(10)$$: apply the Binomial Theorem and integrate
$$(11)$$: $$\binom{k}{j}=\sum\limits_{m=1}^k\binom{k-m}{j-1}$$ and substitute $$j\mapsto j+1$$
$$(12)$$: reorder summation and $$\binom{k-m}{j}\binom{j}{i}=\binom{k-m}{i}\binom{k-m-i}{j-i}$$
$$(13)$$: substitute $$j\mapsto j+i$$
$$(14)$$: apply the Binomial Theorem
$$(15)$$: shift factors of $$2$$
$$(16)$$: apply $$(1)$$
$$(17)$$: substitute $$m\mapsto k-m$$
$$(18)$$: rewrite the Gamma functions as factorials

Thus, $$\bbox[5px,border:2px solid #C0A000]{g(k)=-2^{k-1}\sum_{m=0}^{k-1}\frac{m!}{(2m+1)!!}}\tag{19}$$

$$(4)$$ says that asymptotically, the full sum from the question is $$\frac12\sqrt{\frac\pi{k}}$$, which vanishes as $$k\to\infty$$. Thus, the sum in $$(18)$$ must converge quickly to $$\frac\pi2$$. In fact, the sum in $$(18)$$ is the partial sum of the sum in this question whose limit is $$\frac\pi2$$.

Note that the partial fractions decomposition of the inverse of the Rising Factorial gives: \eqalign{ & \left( {x - 1} \right)^{\,\underline {\, - \left( {m + 1} \right)\,} } = {1 \over {x^{\,\overline {\,m + 1\,} } }} = {{\Gamma (x)} \over {\Gamma (x + m + 1)}} = \;\quad \left| {\;0 \le {\rm integer }\, m} \right.\quad = \cr & = \sum\limits_{0\, \le \,k\, \le \,m} {{1 \over {x + k}}\left( {{{\left( { - 1} \right)^{\,k} } \over {\left( {m - k} \right)!k!}}} \right)} = \sum\limits_{0\, \le \,k\, \le \,m} {{1 \over {x + k}}\left( {{{\left( { - 1} \right)^{\,k} } \over {m!}}\binom{m}{k} } \right)} \cr}

So \eqalign{ & \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \binom{k}{j} {1 \over {2n + 2j + 1}}} = \cr & = {1 \over 2}\sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \binom{k}{j} {1 \over {\left( {n + 1/2 + j} \right)}}} = \cr & = {{k!} \over {2\left( {n + 1/2} \right)^{\,\overline {\,k + 1\,} } }} \cr}

We have then that the sum in $$n$$ is

\eqalign{ & S(k) = \sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \left( \matrix{ k \cr j \cr} \right){1 \over {2n + 2j + 1}}} } = \cr & = {1 \over 2}\sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {{k!} \over {\left( {n + 1/2} \right)^{\,\overline {\,k + 1\,} } }}} = \cr & = {1 \over {2\left( {k + 1} \right)}}\sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {{1^{\,\overline {\,k + 1\,} } } \over {\left( {1 + n - 1/2} \right)^{\,\overline {\,k + 1\,} } }}} = \cr & = {1 \over {2\left( {k + 1} \right)}}\sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {{1^{\,\overline {\,n - 1/2\,} } } \over {\left( {2 + k} \right)^{\,\overline {\,n - 1/2\,} } }}} = \cr & = {{1^{\,\overline {\, - 1/2\,} } } \over {2\left( {k + 1} \right)\left( {2 + k} \right)^{\,\overline {\, - 1/2\,} } }} \sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {{\left( {1/2} \right)^{\,\overline {\,n\,} } } \over {\left( {3/2 + k} \right)^{\,\overline {\,n\,} } }}} = \cr & = {{\Gamma \left( {1/2} \right)\Gamma \left( {2 + k} \right)} \over {2\left( {k + 1} \right)\Gamma \left( 1 \right)\Gamma \left( {3/2 + k} \right) }} \sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {{\left( {1/2} \right)^{\,\overline {\,n\,} } } \over {\left( {3/2 + k} \right)^{\,\overline {\,n\,} } }}} = \cr & = {{\Gamma \left( {1/2} \right)\Gamma \left( {1 + k} \right)} \over {2\,\Gamma \left( {3/2 + k} \right)}}{}_2F_{\,1} \left( {\left. {\matrix{ {1/2\;,\;1} \cr {k + 3/2} \cr } \;} \right| - 1} \right) = \cr & = 2^{\,2\,k} {{\left( {k!} \right)^{\,2} } \over {\left( {2k + 1} \right)!}}\;\;{}_2F_{\,1} \left( {\left. {\matrix{ {1/2\;,\;1} \cr {k + 3/2} \cr } \;} \right| - 1} \right) \cr}

where in the mid of the derivation we have used the identity $${{z^{\,\overline {\,w\,} } } \over {\left( {z + a} \right)^{\,\overline {\,w\,} } }} = {{z^{\,\overline {\,a\,} } } \over {\left( {z + w} \right)^{\,\overline {\,a\,} } }}$$ and at the end the duplication formula for Gamma $$\Gamma \left( {2\,z} \right) = {{2^{\,2\,z - 1} } \over {\sqrt \pi }}\Gamma \left( z \right)\Gamma \left( {z + 1/2} \right) = 2^{\,2\,z - 1} {{\Gamma \left( z \right)\Gamma \left( {z + 1/2} \right)} \over {\Gamma \left( {1/2} \right)}}$$

Alternative Approach

Actually there is a more straight alternative aproach through the Digamma Function \eqalign{ & S(k) = \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \left( \matrix{ k \cr j \cr} \right)\sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {1 \over {2n + 2j + 1}}} } = \cr & = \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \left( \matrix{ k \cr j \cr} \right)\sum\limits_{0\, \le \,m} {\left( {{1 \over {4m + 2j + 1}} - {1 \over {4m + 2j + 3}}} \right)} } = \cr & = {1 \over 4}\sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \left( \matrix{ k \cr j \cr} \right)\sum\limits_{0\, \le \,m} {\left( {{1 \over {m + j/2 + 1/4}} - {1 \over {m + j/2 + 3/4}}} \right)} } = \cr & = {1 \over 4}\sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \left( \matrix{ k \cr j \cr} \right)\left( {\psi \left( {j/2 + 3/4} \right) - \psi \left( {j/2 + 1/4} \right)} \right)} = \cr & = {1 \over 4}\sum\limits_{\left( {0\, \le } \right)\,j\,} {\left( \matrix{ k \cr 2j \cr} \right)\left( {\psi \left( {j + 3/4} \right) - \psi \left( {j + 1/4} \right)} \right) - \left( \matrix{ k \cr 2j + 1 \cr} \right)\left( {\psi \left( {j + 5/4} \right) - \psi \left( {j + 3/4} \right)} \right)} = \cr & = {1 \over 4}\sum\limits_{\left( {0\, \le } \right)\,j\,} {\left( \matrix{ k + 1 \cr 2j + 1 \cr} \right)\psi \left( {j + 3/4} \right) - \left( \matrix{ k \cr 2j \cr} \right)\psi \left( {j + 1/4} \right) - \left( \matrix{ k \cr 2j + 1 \cr} \right)\psi \left( {j + 1 + 1/4} \right)} = \cr & = {1 \over 4}\sum\limits_{\left( {0\, \le } \right)\,j\,} {\left( \matrix{ k + 1 \cr 2j + 1 \cr} \right)\left( {\psi \left( {j + 3/4} \right) - \psi \left( {j + 1/4} \right)} \right) - \left( \matrix{ k \cr 2j + 1 \cr} \right){1 \over {j + 1/4}}} \cr}

Since we can write (re. for instance to this page) \eqalign{ & \psi \left( {j + 3/4} \right) = 4\sum\limits_{0\, \le \,l\, \le \,j - 1\,} {{1 \over {4\,l + 3}}} + {\pi \over 2} - \ln 8 - \gamma = \psi \left( {j + 3/4} \right) - \left( {\psi \left( {3/4} \right) - \left( {{\pi \over 2} - \ln 8 - \gamma } \right)} \right) \cr & \psi \left( {j + 1/4} \right) = 4\sum\limits_{0\, \le \,l\, \le \,j - 1\,} {{1 \over {4\,l + 1}}} - {\pi \over 2} - \ln 8 - \gamma = \psi \left( {j + 1/4} \right) - \left( {\psi \left( {1/4} \right) - \left( { - {\pi \over 2} - \ln 8 - \gamma } \right)} \right) \cr} we arrive to express the sum as \eqalign{ & S(k) = \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \binom{k}{j} \sum\limits_{0\, \le \,n} {\left( { - 1} \right)^{\,n} {1 \over {2n + 2j + 1}}} } = \cr & = {1 \over 4}\sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)} {\left( { - 1} \right)^{\,j} \binom{k}{j} \left( {\psi \left( {j/2 + 3/4} \right) - \psi \left( {j/2 + 1/4} \right)} \right)} = \cr & = {\pi \over 4}2^{\,k} - 2\sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)\,} {\binom{k+1}{2j+1} \left( {\sum\limits_{0\, \le \,l\, \le \,j - 1\,} {{1 \over {\left( {4\,l + 3} \right)\left( {4\,l + 1} \right)}}} } \right)} - \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,\left( {k - 1} \right)/2} \right)\,} {\binom{k}{2j+1}{1 \over {4j + 1}}} = \cr & = {\pi \over 4}2^{\,k} - 2\sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,k} \right)\,} {\binom{k+1}{2j+1} \left( {\sum\limits_{0\, \le \,l\, \le \,j - 1\,} {{1 \over {\left( {4\,l + 2} \right)^{\,2} - 1}}} } \right)} - \sum\limits_{\left( {0\, \le } \right)\,j\,\left( { \le \,\left( {k - 1} \right)/2} \right)\,} {\binom{k}{2j+1}{1 \over {4j + 1}}} \cr}

Interesting the comparison of this expression with the one given by @robjohn

(2) is $$\frac11-\frac23+\frac25-\frac27+\cdots=-1+2\left(\frac11-\frac13+\frac15-\cdots\right),$$ (3) is $$\frac11-\frac33+\frac45-\frac47+\cdots=-3+\frac13+4\left(\frac11-\frac13+\frac15-\cdots\right),$$ (4) is $$\frac11-\frac43+\frac75-\frac87+\cdots=-7+\frac43-\frac15+8\left(\frac11-\frac13+\frac15-\cdots\right),$$ etc.

In general, one gets $$2^k\frac\pi4-\sum_{j=0}^{k-1}(-1)^j\frac1{2j+1} \left(2^k-\sum_{i=0}^j{k\choose i}\right).$$