# an interesting experiment in Ramanujan summation

$\sum_{n=1}^{\infty} e^{n}$

Your first reaction should be “that’s not a convergent series!”. But I don’t think that

should scare you away from the algebra:

$\sum_{n=1}^{\infty} e^{n} = \sum_{n=1}^{\infty} \sum_{m=0}^{\infty} \frac{n^{m}}{m!}$

Swapping summations:

$\sum_{m=0}^{\infty} \frac{1}{m!} \sum_{n=1}^{\infty} n^{m}$

And rewriting the inside:

$\sum_{m=0}^{\infty} \frac{1}{m!} \sum_{n=1}^{\infty} \frac{1}{n^{-m}} = \sum_{m=0}^{\infty} \frac{\zeta(-m)}{m!}$

Now this is a tricky step: we’re outside the part of $\mathbb{C}$ where the standard Dirichlet series actually converges. But lo’ we can ask what’s the Ramanujan summation pulling $\LaTeX$ from wikipedia, we have:

$C(a)=\int_0^a f(t)\,dt-\frac{1}{2}f(0)-\sum_{k=1}^{\infty}\frac{B_{2k}}{(2k)!}f^{(2k-1)}(0)$,

where we set $a=0$ and $f(x)=e^{x}$, we get:

$C(0)=\int_0^0 e^{t}\,dt-\frac{1}{2}-\sum_{k=1}^{\infty}\frac{B_{2k}}{(2k)!}$

And the integral, since the bounds are identical, is zero, thus we have the Ramanujan constant for the series is

$C(0) = -\frac{1}{2}-\sum_{k=1}^{\infty}\frac{B_{2k}}{(2k)!}$

mpmath says this is:

-(0.5) - nsum(lambda n: bernoulli(2*n)/fac(2*n), [1,inf]) =
mpf('-0.58197670686932645')


Now here’s where things get both interesting and screwy, the zeta function $\zeta(s)$ is
defined for all negative real $s$, with trivial zeros at negative even integers. Indeed, throwing
$\sum_{m=0}^{\infty} \frac{\zeta(-m)}{m!}$ into wolfram alpha or mpmath produces

>>> nsum(lambda n: zeta(-n)/fac(n), [0,inf])
mpf('-0.58197670686932645')


But what is this number? It’s $-\frac{1}{e-1}$, or more to the point,

$\sum_{n=1}^{\infty} e^{-n} = \frac{1}{e-1}$

The real question here, then, is not why:
$\sum_{n=1}^{\infty} e^{-n} = - \sum_{m=0}^{\infty} \frac{\zeta(-m)}{m!}$, but in what circumstances does algebra performed on divergent series, and outside the right domain of definition of the zeta function still produce correct results? The direct manipulation of divergent series is much less painful to perform that the Ramanujan summation, and it would be helpful if those circumstances in which direct manipulation is possible to know when one can manipulate without the risk of error.

 >>> nsum(exp, [0,inf]) mpf('-0.58197670686932645')