# A generalization of partition function to the sums of squares

The well known partition function $$p(n)$$ is defined as the number of ways to represent $$n$$ as the sum of natural numbers. An asymptotic formula for $$p(n)$$ is $$p(n)\sim\frac{1}{4n\sqrt{3}}\exp\left(\pi\sqrt{\frac{2n}{3}}\right)$$ which was obtained by Ramanujan. Recently an interesting idea came to me: generalizing the partition function. The number of ways of representing $$n$$ as the sum of four squares is known, and many similar things like number of ways of representing a number as a sum of two squares, etc. are known. But that didn't satisfy me. I wanted to truly generalize it.
So first, I took $$p_2(n)$$, the number of ways of representing $$n$$ as the sum of squares. It is obvious that $$p_2(n)\le p(n)$$. It has been conjectured that $$p_2(n)\sim c\cdot n^{\alpha}\exp(\beta\cdot n^{1/3})$$ where

• $$\alpha=-\frac{7}{6}$$
• $$\beta=\frac{3}{2}\frac{\pi}{2}^{1/3}\zeta\left(\frac{3}{2}\right)^{2/3}$$
• $$c=\frac{\zeta(3/2)^{2/3}}{\sqrt{3}(4\pi)^{7/6}}$$ and the generating function of $$p_2(n)$$ is $$\prod_{m\ge1}\frac{1}{1-n^{m^2}}$$ I found these in an article which was not at all about $$p_2(n)$$ but these two were given for some reason. So my main questions are:
• What more is known about $$p_2(n)$$?
• What is the generating function of $$r_k(n)$$? What is $$r_k(n)$$ is mentioned below.

And the questions which are not necessary to answer but they would be useful for me are:

• How was the conjecture even formulated? I don't think it was formulated because of computational evidence because the formula is too much complicated.
• How can we prove that generating function formula?

Update: $$p_2(n)$$ is on OEIS as entry A001156. From that page, I found that $$p_2(n)\sim3^{-1/2}(4\pi n)^{-7/6}\zeta\left(\frac{3}{2}\right)^{2/3}\exp(3\cdot2^{-4/3}\pi^{1/3}\zeta\left(\frac{3}{2}\right)^{2/3}n^{1/3})$$ Which was proven by Hardy and Ramanujan. Can anyone link an article containing the proof of this asymptotic formula?

See the paper

$$p_2(n)$$ is not a standard notation; but a standard notation if $$r_k(n)$$ (many authors use it), which denotes the number of ways of representing $$n$$ as a sum of $$k$$ squares.

• Your linked paper contains a reference in a footnote on page 374. Hardy's paper is published in the Proceedings of National Academy of Sciences, (Washington), Vol. IV, 1918, pp. 189 – 193, and later (in fuller form and with a slightly different title) in Transactions of American Mathematical Society, Vol. XXI, 1920, pp. 255 – 284. – Paramanand Singh Nov 17 '20 at 14:50
• Hardy's paper in PNAS is titled On the Representation of a Number as the Sum of Any Number of Squares, and in Particular of Five or Seven (doi.org/10.1073/pnas.4.7.189) and the one in TAMS is titled On the representation of a number as the sum of any number of squares, and in particular of five (doi.org/10.1090/S0002-9947-1920-1501144-7) – theHigherGeometer Nov 19 '20 at 5:09

You also asked about the generating function. Write $$r^k(n)$$ for the number of partitions of $$n$$ with each part the $$k$$th power of a positive integer. That generating function is $$\sum_{n=0}^\infty r^k(n)q^n = \prod_{m=1}^\infty \frac{1}{1-q^{m^k}}$$ since the $$m$$th factor on the right is a geometric series $$(1+q^{m^k}+q^{2m^k}+\cdots)$$ accounting for $$0,1,2,\ldots$$ copies of $$m^k$$. (This is at the beginning of the Gafni paper referenced in Thomas Bloom's answer.)

You want to keep track of how many $$k$$th powers are used. Write $$r_j^k(n)$$ for the number of partitions of $$n$$ with exactly $$j$$ parts, each the $$k$$th power of a positive integer. To keep track of the number of $$k\text{th}$$ powers, use Euler's trick of including a tracking variable: $$\sum_{n=0}^\infty r_j^k(n)q^nz^j = \prod_{m=1}^\infty \frac{1}{1-zq^{m^k}}$$ where the geometric series is now $$(1+zq^{m^k}+z^2q^{2m^k}+\cdots)$$.

• Can you evaluate $\sum_{k=0}r_{k}(n)x^n$ rather than $\sum_{n=0}r_{k}(n)x^n$? It would be more helpful. Sorry, I am not good at evaluating generating functions. – Leonhard Euler Nov 18 '20 at 3:59
• I was following the usage of $k$ in the articles, which is different than in your question. If you just care about squares, set $k=2$ in my answer. The first generating function gives the number of partitions of $n$ into any number of squares, which is what I think is what you mean by $\sum_{k=0} r_k(n) x^n$. – Brian Hopkins Nov 18 '20 at 4:13
• Why did the second generating function's value not include $j$? – Leonhard Euler Nov 18 '20 at 8:58
• $j$ appears in the left-hand side of the second generating function; it is the desired exponent of $z$, which tells the number of parts. Neither $n$ nor $j$ appear in the right-hand side of the generating function; $k$ does only because it is fixed and dictates the allowed power of summands. A good source for this material is Herb Wilf's book generatingfunctionality which is freely available online. – Brian Hopkins Nov 18 '20 at 18:04

This asymptotic was stated by Hardy and Ramanujan, but without proof. The first proof of this asymptotic was given by Wright in 1934 [1], by a rather complicated argument. A much simpler approach using the circle method was given by Vaughan in 2015 [2]. Vaughan also gives much more information, allowing for more terms in this asymptotic expansion (see his Theorem 1.5). The introduction of Vaughan's paper gives more information. Vaughan's proof has been generalised to give similar asymptotic formula for the partition function restricted to $$k$$th powers for any $$k\geq3$$ by Gafni [3].

[1] E. M. Wright, Asymptotic partition formulae III. Partitions into $$k$$-th powers, Acta Math. 63 (1934), 143–191. Project Euclid (scanned pdf).

[2] R. C. Vaughan, Squares: Additive questions and partitions, International Journal of Number Theory 11 (2015), 1367–1409. doi:10.1142/S1793042115400096.

[3] A. Gafni, Power partitions, Journal of Number Theory 163 (2016), 19–42. doi:10.1016/j.jnt.2015.11.004, arXiv:1506.06124.

• I would have accepted this but I can't accept two answers. Thanks for your answer, I upvoted it. – Leonhard Euler Nov 18 '20 at 3:52