# Why is $\sum\limits_{n=1}^{\infty}e^{-(n/10)^2}$ almost equal to $5\sqrt\pi-\frac12$ (agreeing up to $427$ digits)?

The following I saw as an exercise in a text on modular forms. I am lacking the understanding for why the following is true, but it is nevertheless astonishing:

Why is the numerical value of

$$x:=\sum_{n=1}^{\infty} \exp(-(n/10)^2)$$

so ridiculously close to the value of

$$y:=5\sqrt\pi-\frac12$$

while (and this is the truly surprising aspect) not being equal to it?

And by "ridiculously close" I mean that $$x$$ and $$y$$ agree up to the 427-th digit after the decimal point:

\begin{align} x=8. &3622692545275801364908374167057259139877472806\\ &1193564106903894926455642295516090687475328369\\ &2723327081134118121412853331180764328622113012\\ &6254685480139353423101884932655256142496258651\\ &4475413114466047689633981400087319507675739860\\ &2583500950926170092927234872474563201569608877\\ &6295310820270966625045319920380686673873757671\\ &6833994894682925918204397725582580869380029533\\ &6967158956664049274231240924510273274260978066\\ &257808237337\color{red}{62} \end{align}

They first disagree in the red digits.

Question: Can someone explain this in "simple" words? It does not have to be elementary, but I want to understand what machinery has to interact to arrive at this. And how would one even come up with such an example, or similar ones?

• +1. I can see why it would be close (because $\frac{1}{10}(x+1/2)$ is a triangular approximation of $\int_0^{+\infty}e^{-t^2}dt=\frac{\sqrt{\pi}}{2}$) - but it is supposed to undershoot the actual integral in the range where $t\to e^{-t^2}$ is concave ($[0,\frac{1}{\sqrt{2}}]$) and overshoot it where it is convex ($[\frac{1}{\sqrt{2}},+\infty)$) and it is amazing that those two errors almost exactly cancel each other.
– user700480
Commented Nov 7, 2020 at 9:31
• That's because of Poisson summation formula (en.wikipedia.org/wiki/Poisson_summation_formula): the Fourier transform of $\displaystyle e^{-\frac{x^2}{100}}$ is decaying very fast.
– user436658
Commented Nov 7, 2020 at 9:41
• On a related note, Patterns That Eventually Fail by John Baez (with a little help from Greg Egan and Peter Borwein). Commented Nov 8, 2020 at 12:06
• @PM2Ring This is an awesome read! Thank you. Commented Nov 8, 2020 at 13:03
• Glad you like it. :) Wikipedia has a short article on Almost Integers, and I'm sure there's a collection of similar stuff on the XKCD forum thread connected to this comic: m.xkcd.com/217 Sadly, the forum is offline, but I guess you can find the thread on the Wayback Machine. Commented Nov 8, 2020 at 13:11

Define $$\psi(q)\equiv-\frac12+\frac12\vartheta_3(0,e^{-\pi q})=\sum_{n\ge1}e^{-\pi n^2q}$$ where $$\vartheta_3(z,q)$$ is Jacobi's third theta function. An application of the Poisson summation formula leads to the identity $$\vartheta_3(0,e^{-\pi/q})=\sqrt q\,\vartheta_3\left(0,e^{-\pi q}\right)$$ whose proof is outlined in Jacobi (1828). Substituting $$q:=(\pi k^2)^{-1}$$ yields $$\sum_{n\ge1}e^{-n^2/k^2}=-\frac12+\frac12\vartheta_3(0,e^{-1/k^2})=-\frac12+\frac12\cdot\sqrt{\pi k^2}\vartheta_3(0,e^{-\pi^2k^2})$$ so that $$\sum_{n\ge1}e^{-n^2/k^2}=-\frac12+\frac k2\sqrt\pi(1+2\psi(\pi k^2))=-\frac12+\frac k2\sqrt\pi+k\sqrt\pi\sum_{n\ge1}e^{-(\pi kn)^2}.$$ When $$k=10$$ the error has an order of magnitude of $$\log_{10}\left(10\sqrt\pi e^{-100\pi^2}\right)=1+\log_{10}\sqrt\pi-100\pi^2\log_{10}e=\bf-427$$ which corresponds to your observation.