In this blog we prove a Ramanujan-type identity:
$$$S(n_1, n_2, n_3) := \sum\limits_{n_1 \in \mathbb{Z}}(-1)^{n_1}\sum\limits_{(n_2, n_3) \in \mathbb{Z}^2}\frac{1}{\sqrt{n_1^2 + (n_2+0.5)^2+(n_3+0.5)^2}\sinh{(\pi\sqrt{n_1^2 + (n_2+0.5)^2+(n_3+0.5)^2})}} = 1$$$. (1)
First, we consider a 4D lattice sum:
$$$U(n_1, n_2, n_3, n_4) := \sum\limits_{(n_1, n_2, n_3, n_4) \in \mathbb{Z}^4} \frac{(-1)^{n_1+n_4}}{n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2 + n_4^2}$$$. We will show later that $$$U(n_1, n_2, n_3, n_4)$$$ equals to $$$\pi$$$ (code shown below).
Note that the above series converge super slow, and the Python code is also super slow. Be patient please!
For $$$\lambda > 0$$$, $$$\int_{0}^\infty e^{-\lambda x}dx = \frac{1}{\lambda}$$$, therefore $$$U(n_1, n_2, n_3, n_4) = \sum\limits_{(n_1, n_2, n_3, n_4) \in \mathbb{Z}^4} \int_{0}^\infty (-1)^{n_1+n_4} \exp((-n_1^2-(n_2+0.5)^2-(n_3+0.5)^2-n_4^2)x)dx$$$. (2)
By the Poisson summation formula of the theta function (see this),
$$$\sum\limits_{n \in \mathbb{Z}}(-1)^n \exp(-n^2 x) = \sqrt{\frac{\pi}{x}} \sum\limits_{n \in \mathbb{Z}}\exp(\frac{-(n+0.5)^2\pi^2}{x})$$$ (3)
By combining (2) and (3), $$$U$$$ can be written as a Mellin-transform-type integral:
$$$U(n_1, n_2, n_3, n_4) = \sum\limits_{(n_1, n_2, n_3, n_4) \in \mathbb{Z}^4} \sqrt{\pi}\int_{0}^\infty (-1)^{n_1} x^{-0.5} \exp(-(n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2)x - \frac{(n_4+0.5)^2\pi^2}{x})dx$$$. (4)
We then use a famous integral representation of the Modified Bessel functions of the second kind
(i.e., $$$K$$$):
$$$M_s[\exp(-ax-\frac{b}{x})] := \int_{0}^\infty x^{s-1}\exp(-ax-\frac{b}{x})dx = 2(\frac{b}{a})^{\frac{s}{2}}K_s(2\sqrt{ab})$$$. (5)
In (5), $$$M_s$$$ denotes the Mellin transform with parameter $$$s$$$. And we note that when $$$s=0.5$$$, $$$K_{0.5}(z)$$$ has a closed-form: $$$K_{0.5}(z) = \sqrt\frac{\pi}{2} \frac{e^{-z}}{\sqrt{z}}$$$.
Then, $$$\int_{0}^\infty x^{-0.5}\exp(-ax-\frac{b}{x})dx = 2(\frac{b}{a})^{0.25} K_{0.5}(2\sqrt{ab}) = 2(\frac{b}{a})^{0.25}\sqrt{\frac{\pi}{2}}\frac{\exp(-2\sqrt{ab})}{\sqrt{2}(ab)^{0.25}} = \sqrt{\frac{\pi}{a}}\exp(-2\sqrt{ab})$$$. (6)
We set $$$a = n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2$$$ and $$$b = (n_4+0.5)^2\pi^2$$$, and
$$$U(n_1, n_2, n_3, n_4) = \sum\limits_{(n_1, n_2, n_3) \in \mathbb{Z}^3} (-1)^{n_1}\frac{\pi}{\sqrt{n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2}}\sum\limits_{n_4 \in \mathbb{Z}} \exp(-\pi |2n_4+1| \sqrt{n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2})$$$. (7)
In (7), the $$$\pi$$$ comes from two places. One $$$\sqrt{\pi}$$$ comes from the Poisson summation formula (Eq.(3)), and the other $$$\sqrt{\pi}$$$ comes from the Bessel function $$$K_{0.5}$$$. $$$\sum\limits_{n_4 \in \mathbb{Z}} \exp(-\pi |2n_4+1| \sqrt{n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2})$$$ is symmetric about $$$n_4 = -0.5$$$. $$$n_4 = 0,1,2,...,\infty$$$ and $$$n_4 = -1,-2,...,-\infty$$$, form two identical geometric series with initial term $$$a_1 := \exp(-\pi \sqrt{n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2})$$$ and common ratio $$$q := \exp(-2\pi \sqrt{n_1^2 + (n_2+0.5)^2 + (n_3+0.5)^2})$$$. Each one contributes $$$\frac{a_1}{1-q}$$$ and they two contribute $$$\frac{2a_1}{1-q} = \frac{1}{\sinh{(\pi\sqrt{n_1^2 + (n_2+0.5)^2+(n_3+0.5)^2})}}$$$ in total, amazing!
Therefore, $$$U(n_1, n_2, n_3, n_4) = \pi S(n_1, n_2, n_3)$$$. It is sufficient to show that $$$U = \pi$$$. Now we check the Zucker1974 paper Exact results for some lattice sums in 2, 4, 6 and 8 dimensions with a scihub link. $$$U(n_1, n_2, n_3, n_4)$$$ is equal to $$$U(2, 2)$$$ (Eq. (2.10)) with $$$s = 1$$$. By checking Table 1 in the paper, $$$U(n_1, n_2, n_3, n_4) = 8\beta(0)\beta(1)$$$, where $$$\beta(s) := \sum\limits_{n=0}^\infty \frac{(-1)^n}{(2n+1)^s}$$$ is the Dirichlet beta function. It is well known that $$$\beta(0) = 0.5$$$ and $$$\beta(1) = \frac{\pi}{4}$$$. Finally, $$$U(n_1, n_2, n_3, n_4) = \pi$$$ and $$$S(n_1, n_2, n_3) = 1$$$.
Related words: Codeforces, lattice sum, Ramanujan, theta function, modular form, integral representation of the Gamma function, Bessel function, hyperbolic sine and hyperbolic cosine (sinh, cosh).
This work is inspired by the Madelung constant.