Evaluating $1-\frac12-\frac13+\frac14+\frac15+\frac16-\cdots$

Solution 1:

In other terms we want to evaluate

$$ \sum_{n\geq 1}(-1)^{n+1}\left(H_{n(n+1)/2}-H_{n(n-1)/2}\right)=\int_{0}^{1}\sum_{n\geq 1}(-1)^{n+1}\frac{x^{n(n+1)/2}-x^{n(n-1)/2}}{x-1}\,dx$$ where the theory of modular forms ensures $$ \sum_{n\geq 0} x^{n(n+1)/2} = \prod_{n\geq 1}\frac{(1-x^{2n})^2}{(1-x^n)}=\prod_{n\geq 1}\frac{1-x^{2n}}{1-x^{2n-1}} $$ but I do not see an easy way for introducing a $(-1)^n$ twist in the LHS. On the other hand, the Euler-Maclaurin summation formula ensures $$ H_n = \log n + \gamma + \frac{1}{2n} - \sum_{m\geq 2}\frac{B_m}{m n^m} $$ in the Poisson sense. Replacing $n$ with $n(n\pm 1)/2$, $$ H_{\frac{n(n+1)}{2}}-H_{\frac{n(n-1)}{2}} = \log\left(\tfrac{n+1}{n-1}\right)+\tfrac{2}{(n-1)n(n+1)}-\sum_{m\geq 2}\tfrac{2^m B_m}{m n^m}\left(\tfrac{1}{(n-1)^m}-\tfrac{1}{(n+1)^m}\right) $$ then multiplying both sides by $(-1)^n$ and summing over $n\geq 2$: $$ \sum_{n\geq 2}(-1)^n\left(H_{\frac{n(n+1)}{2}}-H_{\frac{n(n-1)}{2}} \right)=\\=5\left(\log(2)-\tfrac{1}{2}\right)-\sum_{m\geq 2}\tfrac{2^m B_m}{m}\sum_{n\geq 2}(-1)^n\left(\tfrac{1}{n^m(n-1)^m}-\tfrac{1}{n^m(n+1)^m}\right) \\=5\left(\log(2)-\tfrac{1}{2}\right)-\sum_{m\geq 2}\frac{2^m B_m}{m}\left[\frac{1}{2^m}-2\sum_{n\geq 2}\frac{(-1)^m}{n^m(n+1)^m}\right]$$ where the innermost series is a linear combination of $\log(2),\zeta(3),\zeta(5),\ldots$ by partial fraction decomposition. This allows a reasonable numerical approximation of the original series and a conversion into a double series involving $\zeta(2a)\zeta(2b+1)$. I am not sure we can do better than this, but I would be delighted to be proven wrong.


Playing a bit with functions, a nice approximation of $\sum_{n\geq 0}(-1)^n x^{n(n+1)/2}$ over $[0,1]$ is given by $\frac{1}{x+1}-x^2(1-x)^2$, so the value of the original series has to be close to $\log(2)-\frac{1}{6}$. A better approximation of the function is $\frac{1}{x+1}-x^2(1-x)^2+\frac{3}{4}x^4(1-x)\left(\frac{4}{5}-x\right)$, leading to the following improved approximation for the series: $\log(2)-\frac{53}{300}$. A further refinement, $$ g(x)=\sum_{n\geq 0}(-1)^n x^{n(n+1)/2} \approx \frac{1+x+2x^2}{1+2x+5x^2}$$ leads to $\color{red}{S\approx\frac{\pi+3\log 2}{10}}$. It might be interesting to describe how I got this approximation.
$g(0)$ and $g'(0)$ are directly given by the Maclaurin series, while $\lim_{x\to 1^-}g(x)=\frac{1}{2}$ and $\lim_{x\to 1^-}g'(x)=-\frac{1}{8}$ can be found through $\mathcal{L}(f(e^{-x}))(s)$.
$g(x)$ is convex and decreasing on $(0,1)$ and any approximation of the $$ \frac{1+ax+(1+a)x^2}{1+(1+a)x+(2+3a)x^2}$$ kind with $a$ in a suitable range matches such constraint and the values of $g$ and $g'$ at the endpoints of $(0,1)$. We still have the freedom to pick $a$ in such a way that the derived approximation is both simple and accurate enough - I just picked $a=1$.

Solution 2:

Approximating the Sum

Applying the Euler-Maclaurin Sum Formula to $\frac1n$, we get $$ \begin{align} H_n &=\log(n)+\gamma+\frac1{2n}-\frac1{12n^2}+\frac1{120n^4}-\frac1{252n^6}+\frac1{240n^8}-\frac1{132n^{10}}\\ &\phantom{\,={}}+\frac{691}{32760n^{12}}-\frac1{12n^{14}}+O\!\left(\frac1{n^{16}}\right)\tag1 \end{align} $$ To compute $\sum\limits_{k=1}^\infty(-1)^{k-1}\!\!\left(H_{(k+1)k/2}-H_{k(k-1)/2}\right)$, we will combine the $k=2n-1$ and the $k=2n$ terms and use $(1)$ to estimate $H_n$: $$ \begin{align} \hspace{-5mm}f(n) &=\overbrace{\left(H_{n(2n-1)}-H_{(2n-1)(n-1)}\right)}^{k=2n-1}-\overbrace{\left(H_{(2n+1)n}-H_{n(2n-1)}\right)}^{k=2n}\\ &=\frac1{2n^2}+\frac1{4n^3}-\frac1{8n^4}-\frac3{16n^5}-\frac{19}{96n^6}-\frac{11}{64n^7}-\frac{43}{384n^8}-\frac{41}{768n^9}\\ &\phantom{\,={}}+\frac{27}{2560n^{10}}+\frac{69}{1024n^{11}}+\frac{677}{6144n^{12}}+\frac{557}{4096n^{13}}+\frac{38797}{286720n^{14}}\\ &\phantom{\,={}}+\frac{26107}{245760n^{15}}+\frac{4597}{98304n^{16}}-\frac{2627}{65536n^{17}}-\frac{838061}{5898240n^{18}}-\frac{316167}{1310720n^{19}}\\ &\phantom{\,={}}-\frac{1130847}{3670016n^{20}}-\frac{6769583}{22020096n^{21}}-\frac{23505703}{115343360n^{22}}+\frac{616009}{20971520n^{23}}\\ &\phantom{\,={}}+\frac{29333183}{75497472n^{24}}+\frac{68957009}{83886080n^{25}}+\frac{3688165573}{3053453312n^{26}}+\frac{5672489659}{4227858432n^{27}}\\ &\phantom{\,={}}+\frac{900259265}{939524096n^{28}}-\frac{55931283}{268435456n^{29}}-\frac{18407784799}{8053063680n^{30}}\\ &\phantom{\,={}}-\frac{5422797419}{1073741824n^{31}}+O\!\left(\frac1{n^{32}} \right)\tag2 \end{align} $$ Next, apply the Euler-Maclaurin Sum Formula to $(2)$ to approximate $$ \sum_{k=1}^nf(k)=C+g(n)\tag3 $$ where $$ \begin{align} \hspace{-5mm}g(n) &=-\frac1{2n}+\frac1{8n^2}+\frac1{12n^3}-\frac5{64n^4}+\frac1{240n^5}+\frac{11}{384n^6}-\frac5{1344n^7}-\frac{151}{6144n^8}\\ &\phantom{\,={}}-\frac{13}{11520n^9}+\frac{507}{10240n^{10}}+\frac5{11264n^{11}}-\frac{6797}{49152n^{12}}+\frac{2411}{5591040n^{13}}\\ &\phantom{\,={}}+\frac{623927}{1146880n^{14}}-\frac{29}{737280n^{15}}-\frac{9105847}{3145728n^{16}}-\frac{1269}{5570560n^{17}}\\ &\phantom{\,={}}+\frac{470568199}{23592960n^{18}}-\frac{9641}{174325760n^{19}}-\frac{25364768763}{146800640n^{20}}+\frac{568951}{3633315840n^{21}}\\ &\phantom{\,={}}+\frac{848095747927}{461373440n^{22}}+\frac{163511}{1447034880n^{23}}-\frac{142300201072307}{6039797760n^{24}}\\ &\phantom{\,={}}-\frac{4915843}{38168166400 n^{25}}+\frac{4373467527277213}{12213813248n^{26}}-\frac{2560205}{12683575296n^{27}}\\ &\phantom{\,={}}-\frac{47857489871577677}{7516192768n^{28}}+\frac{2494825}{23353884672n^{29}}+\frac{4218610442394753611}{32212254720n^{30}}\\ &\phantom{\,={}}+O\!\left(\frac1{n^{31}}\right)\tag4 \end{align} $$ Since $\lim\limits_{n\to\infty}g(n)=0$, $(3)$ implies $C=\sum\limits_{k=1}^\infty f(k)$.

We will use the approximation of $g$ given in $(4)$, call it $\tilde{g}$, whose error is $O\!\left(\frac1{n^{31}}\right)$, to get $$ \sum_{k=1}^\infty f(k)=\sum_{k=1}^nf(k)-\tilde{g}(n)+O\!\left(\frac1{n^{31}}\right)\tag5 $$ Here is a table of the values from $(5)$. Note that as we double $n$, we get about $9.63$ more digits of the sum. $$ \begin{array}{r|c|l} n&\substack{\text{harmonic}\\\text{series}\\\text{terms}\vphantom{\text{i}}}&\sum\limits_{k=1}^nf(k)-\tilde{g}(n)\\\hline 5&55&0.517100379042\color{#CCC}{335666895661356664256993223233139202045}\\ 10&210&0.517100379042401725064\color{#CCC}{786300619359787983738352017985}\\ 20&820&0.51710037904240172506481077213135\color{#CCC}{0714320294664965323}\\ 40&3240&0.51710037904240172506481077213135745047250\color{#CCC}{5734079916}\\ 80&12880&0.517100379042401725064810772131357450472507379080669\\ 160&51360&0.517100379042401725064810772131357450472507379080669 \end{array} $$ So with $n=80$, we need to sum $12880$ terms of the Harmonic Series to get $51$ decimal places of the sum. This is pretty good since the sum of that many terms of the series only gives about $2$ decimal places without the correction from $\tilde{g}$.


About the Error Term

Note that in $(4)$, when the exponents are big, the coefficients of the even powers of $n$ are big and the coefficients of the odd powers of $n$ are small. In fact, the coefficient of the $\frac1{n^{31}}$ term is about $\frac1{2516}$ whereas the coefficient for the $\frac1{n^{32}}$ term is about $3085116088$. This means that for $n\lt8\times10^{12}$, the error acts more like $\frac{3085116088}{n^{32}}$ than $\frac1{2516n^{31}}$.

For $n=\,\,5$, this gives about $12.9$ decimal places
For $n=10$, this gives about $22.5$ decimal places
For $n=20$, this gives about $32.1$ decimal places
For $n=40$, this gives about $41.8$ decimal places
For $n=80$, this gives about $51.4$ decimal places

These match the table above. Although, in the table, $n=10$ only matches to $21$ places, the error is actually only $2.4\times10^{-23}$.


Correction to the Proof in the Question

While it is true that the terms in the alternating sum are decreasing, as stated in the question, there is a problem with the proof there. The third line does not imply the second. Here is a fixed proof. $$ \begin{align} &\sum_{i=1}^n\frac1{\frac{n(n-1)}2+i}-\sum_{i=1}^{n+1}\frac1{\frac{n(n+1)}2+i}\\ &=\sum_{i=1}^n\left(\frac1{\frac{n(n-1)}2+i}-\frac1{\frac{n(n+1)}2+i}\right)-\frac1{\frac{(n+2)(n+1)}2}\tag{6a}\\ &=\sum_{i=1}^n\frac{n}{\left(\frac{n(n-1)}2+i\right)\left(\frac{n(n+1)}2+i\right)}-\frac2{(n+2)(n+1)}\tag{6b}\\ &\ge\frac{n^2}{\frac{n(n+1)}2\frac{n(n+3)}2}-\frac2{(n+2)(n+1)}\tag{6c}\\[6pt] &=\frac4{(n+1)(n+3)}-\frac2{(n+2)(n+1)}\tag{6d}\\[9pt] &=\frac2{(n+2)(n+3)}\tag{6e} \end{align} $$ Explanation:
$\text{(6a)}$: move the terms for $i\in[1,n]$ from the right sum into the left sum
$\text{(6b)}$: simplify the difference in the summation
$\text{(6c)}$: replace each term in the sum by the smallest term ($i=n$)
$\text{(6d)}$: simplify
$\text{(6e)}$: subtract