For \(n \in \mathbb{N}\), let \[p(n) = \operatorname{card} \left\{ (k_1, k_2, \dots) \in \mathbb{N}: k_1 p_1 + k_2 p_2 + \dots = n \right\},\] where \(\{p_j\}\) denotes the sequence of primes in increasing order.
Let \[\Phi(z) : \mathbb{D} \to \mathbb{C}, \quad z \mapsto \sum_{n=0}^\infty p(n) z^n\] be a generating function, where \(\mathbb{D}\) denotes the unit disc in \(\mathbb{C}\). By the classical partition function for \(n \in \mathbb{N}\), we see that \(\Phi(z)\) is holomorphic in this region.
Suppose that \(0 < \rho < 1\). With a change of variable from \(z \to \rho \, \mathrm{e(z)}\), we have \[p(n) = \int_C \Phi(z) z^{-n-1} \, \mathrm{d}z = \rho^{-n} \int_{-\pi}^{\pi} \Phi(\rho \, \mathrm{e(z)}) \, \mathrm{e(-n z)} \, \mathrm{d}z.\] Moreover, if one writes for \(x \in (0, \infty)\), let \[f(x) = \rho^{-x} \int_{-\pi}^{\pi} \Phi(\rho \, \mathrm{e(z)}) \, \mathrm{e(-nz)} \, \mathrm{d}z,\] then \(f\) is analytic.
Clearly, \[\Phi(z) = \prod_{p} \sum_{k=0}^\infty z^{k p} = \prod_{p} (1 - z^p)^{-1}.\] It is evident that for every \(k \in \mathbb{N}\) and \(\rho \in (0,1)\), \[\Phi^k(\rho) > 0, \quad\text{and}\] \[\Phi^k(\rho) \to \infty \quad \text{as} \quad \rho \to 1^{-}.\]
Let \[\Psi(z) : \mathbb{D} \to \mathbb{C}, \quad z \mapsto \sum_{p} \sum_{k=1}^\infty \frac{z^{k p}}{k}.\] Note \[\log(\Phi(z)) = - \sum_{p} \log(1 - z^p) = \sum_{p} \sum_{k=1}^\infty \frac{z^{k p}}{k} = \Psi(z),\] so that \[\Phi(z) = \exp\big( \Psi(z) \big).\]
Moreover, for every \(k \in \mathbb{N}\) and \(\rho \in (0,1)\), \[\Psi^{(k)}(\rho) > 0 \quad\text{and}\quad \Psi^{(k)}(\rho) \to \infty \quad \text{as} \quad \rho \to 1^{-}.\]
Thus, for every \(x \ge 0\), the equation \[\rho \, \Psi'(\rho) = x\] has a unique solution \(\rho = \rho(x)\) with \(\rho \in (0,1)\) and \(\rho \to 1^{-}\) as \(x \to \infty\).
The function \[f(\rho) : [0,1) \to [0, \infty), \quad \rho \mapsto \rho \, \Psi'(\rho),\] also satisfies \[f^{(k)}(\rho) > 0 \quad\text{whenever } \rho \in (0,1), \quad\text{and}\quad f^{(k)}(\rho) \to \infty \quad\text{as } \rho \to 1^{-}.\] Since \(f(\rho(x)) = x\), then \(\rho(x)\) is the inverse function of \(f\). It follows that \[\rho'(x) = \frac{1}{f'(\rho(x))} \quad (x \ge x_0),\] and by induction on \(k\) we can show that \(\rho^{(k)}\) exists for every \(k \in \mathbb{N}\) when \(x \ge x_0\).
It is useful to write \[X = \frac{1}{\log(1/\rho)} \quad\text{so that}\quad \rho = e^{-1/X},\] and we use this relationship throughout.
For any arbitrary \(\beta \in \mathbb{R}\), let \(R(\beta)\) and \(I(\beta)\) be the real and imaginary parts of \(\Psi(\rho e^{i\beta})\), respectively. By Taylor’s Theorem, we obtain \[\Psi(\rho e(\alpha)) = \Psi(\rho) + \alpha 2\pi i \rho \, \Psi'(\rho) - \tfrac12 \alpha^2 4\pi^2 \left( \rho \, \Psi'(\rho) + \rho^2 \, \Psi''(\rho) \right)\] \[+ \tfrac{1}{3} w |\alpha|^3 \left| 8\pi^3 \rho^3 \Psi'(\rho) + 24 \pi^2 \rho^2 \Psi''(\rho) + 8\pi^3 \rho^3 \Psi'''(\rho) \right|,\] where \(\alpha \in \mathbb{C}\) with \(|w| \le 1\).
Let \(\rho(n)\) be defined as the solution for \(\rho \, \Psi'(\rho) = n\), then the second term in the Cauchy’s integral would cancel with \(\mathrm{e(n\alpha)}\).
The method is then similar to the Hardy–Littlewood method. Let \(A\) be an arbitrary positive number; we construct \[\mathfrak{M}(q,a) = \left\{ \alpha \in \left[ -\tfrac12, \tfrac12 \right] : \left| \alpha - \frac{a}{q} \right| \le (\log X)^A q^{-1} X^{-1} \right\},\] and \[\mathfrak{M} = \bigcup_{\substack{1 \le q \le (\log X)^A \\ (a,q)=1}} \mathfrak{M}(q,a), \qquad \mathfrak{m} = \left[ -\tfrac12, \tfrac12 \right] \setminus \mathfrak{M}.\] If \(\alpha \in \mathfrak{m}\) with \(X > X_0(A)\), let \[S_n = \sum_{p \le n} \mathrm{e(\alpha p)},\] then with a similar method from the minor arc estimation in the sum of three primes, we obtain \[S_n \ \ll\ (n q^{-1/2} + n^{4/5} + n^{1/2} q^{1/2} \,) (\log n)^3.\] Let \[F(z) = \sum_{p} z^{p}.\] Then \[F(\rho e(\alpha)) = (1 - \rho) \sum_{n=1}^\infty S_n \rho^n\] and \[\Psi(z) = \sum_{k} \frac{1}{k} F(z^k).\]
Therefore, from the bound of \(S_n\), we obtain for \(\alpha \in \mathfrak{m}\), \[\Psi(\rho e(\alpha)) \ \ll\ X (\log X)^{3 - 4/7}.\]
As for \(\alpha \in \mathfrak{M}\), \(\beta = \alpha - \frac{a}{q}\) and \(|\beta| \le (\log X)^A q^{-1} X^{-1}\), then \[F(\rho e(a/q + \beta)) = \sum_{\substack{\ell = 1 \\ (\ell, q) = 1}}^{q} \mathrm{e(\frac{a\ell}{q})} \sum_{p \equiv \ell \, (\mathrm{mod} \, q)} \rho^{p} \, \mathrm{e(\beta p)} + O\big( \omega(q) \big).\] For the inner sum, by the Siegel–Walfisz theorem, we have \[\sum_{p \equiv \ell \, (\mathrm{mod} \, q)} \rho^p \, \mathrm{e(\beta p)} = \int_{2}^{\infty} \rho^u \, \mathrm{e(\beta u)} \, \mathrm{d}\left( \sum_{p \equiv \ell \, (\mathrm{mod} \, q)} 1 \right)\] \[= \int_{2}^{\infty} \rho^u \, \mathrm{e(\beta u)} \, \mathrm{d}\left( \frac{1}{\varphi(q)} \int_{2}^{u} \frac{\mathrm{d}t}{\log t} + O\!\left( u \, e^{-c \sqrt{\log u}} \right) \right).\] By \(\rho = e^{-1/X}\), we obtain the error term \[\ll C(1+X|\beta|) X e^{-c \sqrt{\log X}}.\] Then by estimating the integral, we have \[\Psi(\rho e(\alpha)) = \frac{\pi^2 (-1)^{\omega(q)}}{6 q^2 (\log X) (1 - 2\pi i \beta)} \prod_{p \mid q} \frac{p}{p-1} + O\!\left( \frac{X \log \log X}{(\log X)^2} \right).\] Let \[\left( \rho \frac{\mathrm{d}}{\mathrm{d}\rho} \right)^{j} \Psi(\rho) = \sum_{k=1}^\infty k^{j-1} \rho^{kp} \, k p.\]
Also, by Mellin transform of \(\Gamma(s)\) function for \(\Re s > 0\), \(c > 0\), \[\frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} \Gamma(s) z^{-s} \, \mathrm{d}s = \mathrm{e}^{-z}\] We have \[\left( \rho \frac{\mathrm{d}}{\mathrm{d}\rho} \right)^j \Psi(\rho) = \frac{1}{2\pi i} \sum_{p} \sum_{k=1}^\infty p^{j} k^{j-1} \int_{c-i\infty}^{c+i\infty} (\frac{pk}{X})^{-s} X^s \Gamma(s) \, \mathrm{d}s\] \[= \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} P(s-j) \, \zeta(s+1-j) \, X^s \Gamma(s) \, \mathrm{d}s,\] where \[P(s) = \sum_{p} \frac{1}{p^s},\] and \(c\) is real with \(c > j+1\). We have \[P(s) = \sum_{p} \sum_{\ell=1}^\infty \ell ^{-1}p^{-\ell s} - \sum_{p} \sum_{k \ge 2} k^{-2}p^{-ks} = \log \zeta(s) - D(s).\] Given any \(\delta > 0\), \(D(s)\) converges absolutely and uniformly for \(\Re(s) \ge \tfrac12 + \delta\).
If \(P(s-j)\) is replaced by \(D(s-j)\) in the integrand, then we let \(c = j+ \frac{3}{4}\), and a crude estimation gives the bound \(\ll X^{3/4+j}\).
Then we replace \(P(s-j)\) with \(\log \zeta(s-j)\). This function has a singularity at \(s = j+1\) and is analytic in the zero-free region for \(\zeta(s-j)\) except for \(s\ \): \(s = \sigma\), \(\sigma \le j+1\) .
Let \(T = \exp(\sqrt{\log X})\). Then the integral can be truncated at height \(T\) with an acceptable error and the remaining part moved across the line \(\Re s = 1 + j - c/\log T\), where \(c\) is a small constant, except a loop is made about the singularity at \(s = 1+j\). The loop begins along the bottom and top and edges of the “cut”.
All of the different parts of the contour except for the parts along the cut again contribute only to the error term. Along the bottom and the top edges of the cut of the function \(\zeta(s+1-j) X^s \Gamma(s)\) has the same value, but \(\log \zeta(s-j)\) differs by \(2\pi i\). Hence the contribution from the parts along the cut is \[\frac{1}{2\pi i} \int_{0}^{\frac{c}{\log T}} 2\pi i \, \zeta(2-u) \, X^{j+1-u} \, \Gamma(1+j-u) \, \mathrm{d}u\] and since, for any given \(j\), \[\zeta(2-u) \, \Gamma(1+j-u) = \zeta(2) \, \Gamma(1+j) + O(u)\] uniformly for \(u \in [0, \frac{1}{2}]\) it follows that the above is \[X^{j+1} \frac{\zeta(2) \, \Gamma(1+j)}{\log X} + O\!\left( \frac{X^{j+1}}{(\log X)^2} \right).\]
And since \[\rho^j \Psi^{(j)}(\rho) = \sum_{i=1}^j C_{i,j} \left( \rho \frac{\mathrm{d}}{\mathrm{d}\rho} \right)^i \Psi(\rho),\] where the \(C_{i,j}\) are real numbers with \(C_{j,j} = 1\), then by induction we can prove \[\Psi^{(j)}(\rho) = \frac{\pi^2 j! \, X^{j+1}}{6 \log X} + O\!\left( \frac{X^{j+1}}{(\log X)^2} \right).\] Recall we define \(\rho(x)\) as the solution to \(\rho' \Psi(\rho) = x\), then \[x = \frac{\pi^2X(x)^2}{6 \log X(x)} + O\left( \frac{X(x)^{2}}{(\log X(x))^2} \right),\] \[\begin{aligned} \log x &= \log \frac{\pi^2X(x)^2}{6 \log X(x)} + \log \left( 1 + O\left( \frac{1}{\log X(x)} \right) \right)\\ &= 2 \log X(x) - \log \log X(x) + O(1),\end{aligned}\] \[\log \log x = \log \log X(x) + O(1),\] \[\log X(x) = \frac{1}{2} \log x + \frac{1}{2} \log \log x + O(1),\] \[X(x)^2\left( 1 + O\left( \frac{1}{\log X} \right) \right) = \frac{6x}{\pi^2} \left( \frac{1}{2} \log x + \frac{1}{2} \log \log x + O(1) \right),\] \[X(x)^2 = \frac{3}{\pi^2} x\log x \left( 1 + \frac{\log \log x}{\log x} + O\left( \frac{1}{\log x} \right) \right),\] \[X(x) = \frac{\sqrt{3x\log x}}{\pi} \left( 1 + \frac{\log \log x}{2\log x} + O\left( \frac{1}{\log x} \right) \right).\] Hence, \[\rho(x) = 1 + O\!\left( \frac{1}{X(x)} \right) = 1 + O\!\left( \frac{1}{\sqrt{x\log x}} \right)\] \[\Psi'(\rho(x)) = x + O\!\left( x^{\frac{1}{2}} (\log x)^{-\frac{1}{2}} \right)\] \[x \log \frac{1}{\rho(x)} = \frac{x}{X(x)} = \pi \frac{\sqrt{x}}{\sqrt{3 \log x}} \left( 1 - \frac{\log \log x}{2 \log x} + O\big(\frac{1}{\log x}\big) \right)\] and, \[\Psi(\rho(x)) = \frac{\pi^2 X(x)}{6 \log X(x)} + O\!\left( \frac{X(x)}{(\log X(x))^{2}} \right)\] \[= \pi \frac{\sqrt{x}}{\sqrt{3 \log x}} \left( 1 + \frac{\log \log x}{\log x} + O\!\left( \frac{1}{\log x} \right) \right)\] Furthermore, when \(j \ge 1\), \[\begin{aligned} \Psi^{(j)}(\rho(x)) &= j! \, X(x)^{j-1} \, \Psi'(\rho(x)) \left( 1 + O\!\left( \frac{1}{\log X(x)} \right) \right)\\ &= j! \, (3x \log x)^{\frac{j-1}{2}} \, \pi^{1-j} \, x \left( 1 + \frac{\log \log x}{\log x} + O\!\left( \frac{1}{\log x} \right) \right)\left( 1 + O\!\left( \frac{1}{\log x} \right) \right)\\ &= j! \, \pi^{1-j} (3 \log x)^{\frac{j-1}{2}} \, x^{\frac{j+1}{2}} \left( 1 + O\!\left( \frac{\log \log x}{\log x} \right) \right)\end{aligned}\] and similarly for \[\Psi_{(j)}(\rho(x)) = \left( \rho \frac{d}{d\rho} \right)^j \Psi(\rho)\] Let \(A = 40\), and by separate \([-\frac{1}{2},\frac{1}{2}]=[-\tau,\tau]\cup[-\frac{1}{2},-\tau ]\cup[\tau,\frac{1}{2}]\), with \(\tau = (\log X)^{-\frac{1}{4}} X^{-1}\), then for \(\alpha \ge |\tau|\), by estimation of the major and minor arc we obtain the error term \[p(n) = \rho^{-n} \int_{\mathcal{-\tau}}^{\tau} \Phi(\rho \, \mathrm{e(\alpha)}) \, \mathrm{e(-n\alpha)} d\alpha + O\!\left( \frac{\Psi(\rho)}{\rho^n n^{10}} \right)\] By previous estimation of each term of the Taylor’s expansion of the integrand, it follows that \[p(n) = \frac{\rho(n)^{-n} \, \Phi(\rho(n))}{\sqrt{2\pi \, \Psi_2(\rho(n))}} \left( 1 + O\!\left( n^{-\frac{1}{5}} \right) \right)\] and \[\frac{1}{\sqrt{2\pi \, \Psi_2(\rho(n))}} \sim 2^{-1} (3 \log n)^{-\frac{1}{4}} \, n^{-\frac{3}{4}}\]