# A relation concerning the “sum of squares” counting function $r_2(n)$

Let $$r_2(n)$$ denote the number of ways in which a positive integer $$n$$ can be expressed as the sum of squares of two integers. Here the sign as well as order of summands matters. Also by convention we set $$r_2(0)=1$$.

G. H. Hardy mentions the following formula in his book Ramanujan : Twelve Lectures on Subjects Suggested by His Life and Work (see page $$82$$) $$\sum_{0\leq n This is preceded by mention of another formula of Ramanujan $$\sum_{n = 0}^{\infty}\frac{r_{2}(n)}{\sqrt{n + a}}e^{-2\pi\sqrt{(n + a)b}} = \sum_{n = 0}^{\infty}\frac{r_{2}(n)}{\sqrt{n + b}}e^{-2\pi\sqrt{(n + b)a}}\tag{2}$$ which is proved here. Next Hardy says that the above formula of Ramanujan is valid when $$\sqrt{a}, \sqrt{b}$$ have positive real parts. Putting $$a=xe^{it}$$ for $$x>0, x\notin\mathbb{Z} ,0 in $$(2)$$ and letting $$t\to\pi$$ followed by equating imaginary parts and setting $$b=0$$ the relation $$(1)$$ is obtained.

And then comes the remark "this deduction, of course, is not a proof of $$(1)$$ and I do not know that there is any proof standing in the literature".

Has a proof of $$(1)$$ been found since? If so a reference would be greatly appreciated. Can the deduction mentioned above be fixed by making some modification? Any other approaches to prove $$(1)$$ are also welcome.

• I think it is using that both $f(x) = \sum_n r_2(n) e^{-nx}$ and $g(x)= \sum_{n\ge 1} n^{-1/2} e^{-n^{1/2} x}$ transform nicely under $x \to 1/x$ – reuns Oct 20 '18 at 15:23
• @reuns: I understand the transformation relating $f(x)$ and $f(1/x)$ as it is based on theta functions. But I have no idea about transformation of $g(x)$. Also can you please elaborate further (perhaps as a partial answer) on the role of $f, g$ for this problem? – Paramanand Singh Oct 23 '18 at 8:03
• This is not a rigorous proof, but another method how to obtain eq. (2). Eq. (2) is a consequence of the following self-reciprocal Fourier function of 2 variables $$\frac{2}{\pi}\int\limits_0^\infty \int\limits_0^\infty \frac{e^{-\beta\sqrt{x^2+y^2+\beta^2}}}{\sqrt{x^2+y^2+\beta^2}}\cos ax\cos by\phantom{.}dxdy=\frac{e^{-\beta\sqrt{a^2+b^2+\beta^2}}}{\sqrt{a^2+b^2+\beta^2}}.$$ Just apply 2D Poisson summation formula and then combine double sums into single sum using the sum of squares function. – Nemo Nov 10 '18 at 7:35