# Curious relation between $e$ and $\pi$ that produces almost integers

I have seen in an article, without proof, that the following expression involving $e$ and $\pi$ is an almost integer very close to 1:

$e^{-\frac{\pi}{9}} + e^{-4\frac{\pi}{9}} + e^{-9\frac{\pi}{9}} + e^{-16\frac{\pi}{9}} + e^{-25\frac{\pi}{9}} + e^{-36\frac{\pi}{9}} + e^{-49\frac{\pi}{9}} + e^{-64\frac{\pi}{9}} = 1.0000000000010504...$

Furthermore, I have read that the following "approximate theorem" holds

If $n$ is an odd square, then

$\sum\limits_{k = 1}^{n-1} e^{-k^2\frac{\pi}{n}}$

is an almost integer. By some experiments I see easily that the integer being approximated is

($\sqrt{n} - 1)/2$

How to prove that this curious relation holds?

• Could you give a link to the article? – Yuriy S Dec 26 '16 at 21:15
• I have a question: how can you "simply" see what it gives $(\sqrt{n}-1)/2$? It seems hard to be noticed. – John Mayne Dec 26 '16 at 22:31
• That depend of how easy you can recognize patterns. For $n = 9, 25, 49...$ the almost integer being approximated are $1, 2, 3...$. It's natural to look the relation between these integers and the specific choice of the n's. In all cases, it's easy to see that $1 = (3 - 1)/2$, $2 = (5 - 1)/2$, where $3^2 = 9, 5^2 = 25$. Nothing specially hard. – user397987 Dec 26 '16 at 22:38
• @YuriyS I finally found the article: gdz.sub.uni-goettingen.de/dms/load/img/… – user397987 Dec 26 '16 at 23:51
• @user231312, thanks. Nice question! – Yuriy S Dec 27 '16 at 9:32

Using the identity provided by Robert Israel (which can be derived using the Poisson summation formula), we have $$\sum_{k = -\infty}^{\infty}e^{-k^2\tfrac{\pi}{n}} = \sum_{k = -\infty}^{\infty}\sqrt{n}e^{-n\pi k^2}.$$

We can bound the second summation by: $$\sqrt{n} \le \displaystyle\sum_{k = -\infty}^{\infty}\sqrt{n}e^{-n\pi k^2} = \sqrt{n}+2\sqrt{n}\displaystyle\sum_{k = 1}^{\infty}e^{-n\pi k^2} \le \sqrt{n}+2\sqrt{n}\displaystyle\sum_{k = 1}^{\infty}e^{-n\pi k} = \sqrt{n} + \dfrac{2\sqrt{n}}{e^{n\pi}-1}.$$

Also, we can bound the tails of the first summation by:

$$2e^{-n\pi} \le \displaystyle\sum_{|k| \ge n}e^{-k^2\tfrac{\pi}{n}} = 2\displaystyle\sum_{k = n}^{\infty}e^{-k^2 \tfrac{\pi}{n}} \le 2\displaystyle\sum_{k = n}^{\infty}e^{-nk \tfrac{\pi}{n}} = \dfrac{2e^{-n\pi}}{1-e^{-\pi}}.$$

Hence, $$\displaystyle\sum_{k = -(n-1)}^{n-1}e^{-k^2\tfrac{\pi}{n}} = \sum_{k = -\infty}^{\infty}\sqrt{n}e^{-n\pi k^2} - \displaystyle\sum_{|k| \ge n}e^{-k^2\tfrac{\pi}{n}}$$ can be bounded by $$\sqrt{n}-\dfrac{2e^{-n\pi}}{1-e^{-\pi}} \le \displaystyle\sum_{k = -(n-1)}^{n-1}e^{-k^2\tfrac{\pi}{n}} \le \sqrt{n} + \dfrac{2\sqrt{n}}{e^{n\pi}-1}-2e^{-n\pi}.$$

To bound $\displaystyle\sum_{k = 1}^{n-1}e^{-k^2\tfrac{\pi}{n}}$, simply subtract $1$ (for the $k = 0$ term) and divide by $2$ (since the $-k$-th term and the $k$-th term are equal) to get

$$\dfrac{\sqrt{n}-1}{2}-\dfrac{e^{-n\pi}}{1-e^{-\pi}} \le \displaystyle\sum_{k = 1}^{n-1}e^{-k^2\tfrac{\pi}{n}} \le \dfrac{\sqrt{n}-1}{2} + \dfrac{\sqrt{n}}{e^{n\pi}-1}-e^{-n\pi}.$$

Thus, the error in approximating $\dfrac{\sqrt{n}-1}{2}$ is at most $\max\left\{\dfrac{e^{-n\pi}}{1-e^{-\pi}},\dfrac{\sqrt{n}}{e^{n\pi}-1}-e^{-n\pi}\right\}$. For $n = 9$, this is roughly $1.051\times 10^{-12}$.

This comes from the identity

$$\sum_{m=-\infty}^\infty e^{-\pi m^2 x} = x^{-1/2} \sum_{n=-\infty}^\infty e^{-\pi n^2/x}$$

Take $x = 1/9$, and note that $\exp(-9 \pi n^2)$ is very small except for $n=0$, while $\exp(-\pi n^2/9)$ is small for $|n| > 8$.