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

What is the value of $$S=1-\frac12-\frac13+\frac14+\frac15+\frac16-\cdots$$ where the sign alternates over the triangular numbers?

To start, it is easy to prove convergence. The sum of each set of reciprocals (e.g. $$\{1/2,1/3\}$$ and $$\{1/4,1/5,1/6\}$$) can be written as $$\sum_{i=1}^n\frac1{\frac{n(n-1)}2+i},\quad n=1,2,\cdots$$ and it can be shown that it is monotonically decreasing (and tending towards zero) since \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}&\impliedby \sum_{i=1}^n\frac1{\frac{n(n-1)}2+i}-\sum_{i=1}^n\frac1{\frac{n(n+1)}2+i}>\frac2{n^2+3n+2}\\&\impliedby \sum_{i=1}^n\frac 1{(n^2-n+2i)(n^2+n+2i)}>\frac1{2n(n+1)(n+2)}\\&\impliedby \frac n{(n^2-n+2\cdot1)(n^2+n+2\cdot1)}>\frac1{2n(n+1)(n+2)}\\&\impliedby (n-2)(n^2+n+2)<2n^2(n+2)\\&\impliedby n^3+5n^2+4>0\end{align} Is there a closed-form expression for the value of $$S$$?

• If you're curious, the general term can be written as $$\frac{(-1)^{\lfloor \sqrt{2n-7/4}+1/2\rfloor}}{n}$$ – Franklin Pezzuti Dyer Dec 10 '18 at 20:52
• If we define the function $$f(x)=1-x-x^2+x^3+x^4+x^5-...$$ Then we have that $$\frac{1-x}{2}f(x)=\sum_{n=1}^\infty (-1)^n x^{n(n+1)/2}$$ Which suggests some sort of representation in terms of [Theta Functions][1]. From here, we have that the sum you're asking about can be written as $$1-\frac{1}{2}-\frac{1}{3}+\frac{1}{4}+\frac{1}{5}+\frac{1}{6}-...=\int_0^1 f(x)dx$$ Perhaps, after seeing this, someone who knows more about Theta functions can swoop in and simplify this to something more useful or satisfying. [1]: en.wikipedia.org/wiki/Theta_function – Franklin Pezzuti Dyer Dec 10 '18 at 21:06
• @Frpzzd That sum is actually $[(1-x)/2] f(x) -1/2$. – eyeballfrog Dec 10 '18 at 21:50
• @Frpzzd It seems it's really $[(1-x)/2]f(x) + 1/2$, and it's too late for me to edit my comment too. – eyeballfrog Dec 10 '18 at 22:22
• Hey there, @TheSimplifire ! I am suspended from chat until later Tuesday, so I can not respond in the chatroom in which you pinged me (thought I can still get pings, and read everything.) Wow!! I'm sorry about the hammer on the area 51 math challenges proposal. I know you've put a heck of a lot of time into navigating the proposal, and site, to make it viable. But don't take it personally. And you've got the kind of motivation and determination to see possibly a different proposal through, or, to become a mod on MSE!! ;-) – amWhy Dec 16 '18 at 20:06

$$\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$$.