Skip to main content
4 of 4
mpmath works purely numerically
joro
  • 25.4k
  • 10
  • 66
  • 121

Why mpmath computes $\sum_{n=2}^\infty (-1)^n\log(n)=\log\left(\frac1 2 \sqrt{2} \sqrt{\pi}\right)$

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.

joro
  • 25.4k
  • 10
  • 66
  • 121