Exact value of $\sum\limits_{n=1}^\infty(-1)^{n(n+1)/2}/n$? Wolfram is not computing it properly. What is the exact value of
$$\sum_{n=1}^\infty\frac{(-1)^{n(n+1)/2}}{n}?$$ How to avoid imaginary $i$ coming from the exponent?
 A: The series looks like
$$-\frac11-\frac12+\frac13+\frac14-\frac15-\frac16+\frac17+\frac18-\cdots$$
which may be reduced to
$$-\left (1-\frac13+\frac15-\cdots \right ) - \frac12 \left (1-\frac12+\frac13-\cdots \right )$$
which reduces to
$$-\frac{\pi}{4} - \frac12 \log{2}$$
A: Hint: $(-1)^{n(n+1)/2}$ will take two times the value $-1$, two times the value $1$ and so on.
Writing this as two sums should return $\quad-\dfrac{\log 2}2-\dfrac{\pi}4$.
A: Powers of $-1$ work modulo $2$, so you need to compute
$$n(n+1)/2\mod 2$$
This thing has a period $4$:
$$n=\{1,1,0,0,1,1,0,0,1,1,0,0,\ldots\}\mod 2$$
You can split into two sums and evaluate them separately.
A: Hint: Split the sum into four parts
$$
\sum_{n=1}^\infty\frac{(-1)^{\frac{n(n+1)}{2}}}{n}=
\sum_{n=0}^\infty\Big(-\frac{1}{4n+1}
-\frac{1}{4n+2}
+\frac{1}{4n+3}
+\frac{1}{4n+4}\Big)
$$
Then combine two parts with different signs.
The partial sums up to $m$ can be expressed with the digamma function $\psi$ and the asymptotic series is
$$-\frac{1}{2}\ln(2)-\frac{1}{4}\pi+ \frac{1}{4m}-\frac{9}{32m^2}+O(m^{-3})$$
