The well known [partition](https://en.wikipedia.org/wiki/Partition_(number_theory)) 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](https://en.wikipedia.org/wiki/Jacobi%27s_four-square_theorem) 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](http://oeis.org/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


* G. H. Hardy, S. Ramanujan, *Asymptotic formulæ in combinatory analysis*, Proceedings of the London Mathematical Society (series 2) **17** (1918) pp75—115, doi:[10.1112/plms/s2-17.1.75](https://doi.org/10.1112/plms/s2-17.1.75), ([scanned pdf](https://zenodo.org/record/1560148/files/article.pdf), [retypeset pdf](http://ramanujan.sirinudi.org/Volumes/published/ram36.pdf)).


$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.



A generalization of partition function to the sums of squares
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)$.


