TITLE: Why mpmath computes $\sum_{n=2}^\infty (-1)^n\log(n)=\log\left(\frac1 2 \sqrt{2} \sqrt{\pi}\right)$
QUESTION [7 upvotes]: Working with precision 500 decimal digits, mpmath in sage computes:
$$\sum_{n=2}^\infty (-1)^n\log(n)=\log\left(\frac1 2 \sqrt{2} \sqrt{\pi}\right).\tag{1}\label{1}$$
We believe the LHS of \eqref{1} diverges, so this isn't true.

Q1. Are there theoretical reasons for mpmath to compute \eqref{1}?

online code
Added Despite the interesting answers, I am ready bet mpmath
doesn't do any analytic stuff not related to summation, it
works purely numerically and the function is treated as black box,
returning real number.

REPLY [7 votes]: As shown in my previous answer, the value of the sum that you see is
$$\lim_{t\uparrow1}\sum_{n=2}^\infty (-t)^n \ln n. $$
Here is a "manual" way to show this. Writing
\begin{equation}
    \ln n=\int_0^\infty dz\,\frac{e^{-z}-e^{-nz}}z,
\end{equation}
for $t\uparrow1$ we have
\begin{equation}
\begin{aligned}
&\sum_{n=2}^\infty (-t)^n \ln n \\ 
    &=\sum_{n=2}^\infty (-t)^n \int_0^\infty dz\,\frac{e^{-z}-e^{-nz}}z \\ 
    &=\int_0^\infty \frac{dz}z\sum_{n=2}^\infty (-t)^n (e^{-z}-e^{-nz}) \\ 
    &=\frac{t^2}{1+t}\int_0^\infty \frac{dz}z\,e^{-z}\frac{1-e^{-z}}{1+t e^{-z}} \\ 
    &\to\frac12\int_0^\infty \frac{dz}z\,e^{-z}\frac{1-e^{-z}}{1+e^{-z}} \\ 
    &=-\int_0^1 \frac{dx}{\ln x}\,\frac{1-x}{1+x} 
    = \frac12\,\ln\frac\pi2, 
\end{aligned}   
\end{equation}
by (say) Formula 4.267.1 on p. 545 in I.S. Gradshteyn and I.M. Ryzhik, Table of Integrals, Series, and Products, Seventh Edition, 2007.