1 Introduction and statement of results

Let n be a positive integer. A partition of n is a weakly decreasing sequence of positive integers that sum to n. The number of partitions of n is denoted by p(n). For example, one has \(p(4) = 5\), since the relevant partitions are

$$\begin{aligned} 4, \qquad 3+1, \qquad 2+2, \qquad 2+1+1, \qquad 1+1+1+1. \end{aligned}$$

When \(\lambda _1 + \cdots + \lambda _r = n\), the \(\lambda _j\) are called the parts of the partition \(\lambda = (\lambda _1, \ldots , \lambda _r)\), and we write \(\lambda \vdash n\) to denote that \(\lambda \) is a partition of n. The partition function has no elementary closed formula, nor does it satisfy any finite order recurrence. However, when defining \(p(0) := 1\), its generating function has the following product expansion

$$\begin{aligned} \sum _{n \ge 0} p(n)q^n = \prod _{k \ge 1} \frac{1}{1-q^k} = \frac{q^{\frac{1}{24}}}{\eta (\tau )}, \end{aligned}$$
(1.1)

where as usual \(q := e^{2\pi i \tau }\) and \(\eta (\tau )\) denotes the Dedekind eta function. In [13], Hardy and Ramanujan used (1.1) to show the asymptotic formula

$$\begin{aligned} p(n) \sim \frac{1}{4\sqrt{3} n} \exp \left( \pi \sqrt{\frac{2n}{3}}\right) , \qquad n \rightarrow \infty . \end{aligned}$$
(1.2)

For their proof they introduced the circle method, certainly one of the most useful tools in modern analytic number theory. The now so-called Hardy–Ramanujan circle method uses modular type transformations to obtain a divergent asymptotic expansion whose truncations approximate p(n) up to small errors. A later refinement by Rademacher [20], exploiting the modularity of \(\eta (\tau )\), provides a convergent series for p(n).

In this work we study the distribution of ordinary partitions whose number of parts are congruent to some residue class a modulo b.Footnote 1 The number of such partitions \(\lambda \vdash n\) is denoted by p(abn).Footnote 2 It is well known that the numbers p(abn) are asymptotically equidistributed; i.e.,

$$\begin{aligned} p(a,b,n) \sim \frac{p(n)}{b}, \qquad n \rightarrow \infty . \end{aligned}$$
(1.3)

The proof of (1.3) begins by writing the generating function for p(abn) in terms of non-modular eta-products twisted with roots of unity modulo b which is a direct consequence of the orthogonality of roots of unity:

$$\begin{aligned} \sum _{n \ge 0} p(a,b,n)q^n = \frac{1}{b} \left( \frac{q^{\frac{1}{24}}}{\eta (\tau )} + \sum _{b-1 \ge j \ge 1}\frac{\zeta _b^{-ja}}{ \left( \zeta _b^jq; q\right) _\infty }\right) , \end{aligned}$$
(1.4)

where \((a;q)_\infty := \prod _{n \ge 0} (1-aq^n)\) denotes the usual q-Pochhammer symbol and \(\zeta _b := e^{\frac{2\pi i}{b}}\). Since the first term does not depend on a and dominates the other summands, (1.3) can be seen as a corollary of (1.4). Similar results have also been proved for related statistics. For example, the rank of a partition is defined to be the largest part minus the number of parts; Males [17] showed that the Dyson rank function N(abn) (the number of partitions with rank congruent to a modulo b) is asymptotically equidistributed. Males’ proof uses Ingham’s Tauberian theorem [15] and exploits the modularity of the generating function of N(abn), which is given in terms of twisted generalizations of one of Ramanujan’s famous mock theta functions. In contrast, the twisted eta-products in (1.4) lack modularity.

If we now consider differences, \(p(a_1,b,n)-p(a_2,b,n)\), the main terms in (1.4) cancel and the behavior must be determined by secondary terms. In the following example we look at the differences of two modulo 5 partition functions (Fig. 1).

Example 1.1

Consider the case \(a_1 = 1\), \(a_2 = 4\) and \(b = 5\). The q-series of the differences has the following oscillating shape

$$\begin{aligned} \sum _{n \ge 0} \left( p(1,5,n) - p(4,5,n)\right) q^n =&q+q^2+q^3 -q^7-2 q^8 -3 q^9-4 q^{10} -4 q^{11}-5 q^{12} -6 q^{13}-7 q^{14} \\&-7 q^{15}-7 q^{16} - \cdots + 2q^{22} + \cdots + 109q^{40} + \cdots + 11q^{48} - 24q^{49} \\&- \cdots - 1998q^{75} - \cdots - 266q^{85} + 163q^{86} + \cdots + 40511 q^{120} + \cdots \\&+ 3701 q^{133} -3587 q^{134} - \cdots . \end{aligned}$$
Fig. 1
figure 1

For \(b= 5\), \(a_1 = 1\) and \(a_2=4\), we plot the difference \(p(1,5,n)-p(4,5,n)\) with log-scaling. The abrupt vertical changes in the graph indicate the location of the sign changes in the sequence

Our first result predicts this oscillation as follows. As usual, we define the dilogarithm for \(|z|\le 1\) by the generating series

$$\begin{aligned} \mathrm {Li}_2(z):=\sum _{n \ge 1} \frac{z^n}{n^2}. \end{aligned}$$

Throughout we use the principle branch of the complex square root and logarithm.

Theorem 1.2

Let \(b \ge 5\) be an integer. Then for any two residue classes \(a_1 \not \equiv a_2 \pmod {b}\), we have

$$\begin{aligned} \frac{p(a_1,b,n) - p(a_2,b,n)}{B n^{-\frac{3}{4}} \exp \left( 2\lambda _1 \sqrt{n}\right) } = \cos \left( \beta + 2\lambda _2 \sqrt{n}\right) + o(1), \end{aligned}$$

as \(n \rightarrow \infty \), whereFootnote 3\(\lambda _1 + i\lambda _2 := \sqrt{\mathrm {Li}_2(\zeta _b)}\) and \(B > 0\) and \(0 \le \beta < 2\pi \) are implicitly defined by

$$\begin{aligned} Be^{i\beta } := \frac{1}{b}(\zeta _b^{-a_1} - \zeta _b^{-a_2}) \sqrt{\frac{(1 - \zeta _b)(\lambda _1 + i\lambda _2)}{\pi }}. \end{aligned}$$

A more general version of Theorem 1.2 holds for values \(b \ge 2\), see Theorem 3.5, where the special cases \(b \in \{2,3,4\}\) have to be treated slightly differently. Figure 2 shows that this prediction is surprisingly accurate even for small n.

Fig. 2
figure 2

The plot shows the sign changes of \(p(1,5,n)-p(4,5,n)\). The blue dots depict the function \(\frac{p(1,5,n)-p(4,5,n)}{Bn^{-\frac{3}{4}}e^{2\lambda _1\sqrt{n}}}\) and the red line is the asymptotic prediction \(\cos \left( \beta + 2\lambda _2 \sqrt{n}\right) \). The approximate values of the constants are \(B \approx 0.23268\), \(\beta \approx 1.4758\), \(\lambda _1 \approx 0.72984\) and \(\lambda _2\approx 0.68327\)

The proof makes use of (1.4) and a detailed study of the coefficients \(\sum _{n \ge 0} Q_n(\zeta )q^n := (\zeta q; q)^{-1}_\infty \) when \(\zeta \) is a root of unity. Prompted by a question of Stanley, a study of the polynomials \(Q_n(\zeta )\) and their complex zeroes was undertaken in a series of papers by Boyer, Goh, Keith and Parry (see [4,5,6,7, 18]), and the functions \((\zeta q; q)^{-1}_\infty \) have also been studied in recent work of Bringmann, Craig, Males, and Ono [8] in the context of distribution of homology of Hilbert schemes and t-hook lengths. Asymptotics for \(Q_n(\zeta )\) were studied by Wright [24] when \(\zeta \) is any positive real number, and then by Boyer and Goh [4, 5] for \(|\zeta |\ne 1\). Our results essentially complete this study, proving asymptotics when \(\zeta \) is any root of unity.

We use the circle method in the form of Parry [18] as a template; however, significant technical effort is required to bound minor arcs that one does not encounter when \(|\zeta |\ne 1\). For example, we have to overcome the fact that when \(\zeta \) is a root of unity, the series representation of the polylogarithm \(\mathrm {Li}_s(\zeta )\) does not converge for \(\mathrm {Re}(s) < 0\).

Asymptotics in the case that \(b \ge 5\) are as follows, and a general version with the sporadic cases \(b \in \{2,3,4\}\) is stated in Theorem 3.2.

Theorem 1.3

Let \(b \ge 5\). Then we have

$$\begin{aligned} Q_n\left( \zeta _b\right) \sim \frac{\sqrt{1-\zeta _b}\mathrm {Li}_2\left( \zeta _b\right) ^{\frac{1}{4}}}{2\sqrt{\pi }n^{\frac{3}{4}}}\exp \left( 2\sqrt{\mathrm {Li}_2\left( \zeta _b\right) }\sqrt{n}\right) , \qquad n \rightarrow \infty . \end{aligned}$$

Remark 1.4

Our techniques for bounding minor arcs seem not to readily apply when \(|\zeta |=1\) and \(\zeta \) is not a root of unity, so we leave it as an open problem to prove asymptotic formulas for \(Q_n(\zeta )\) in this case. Boyer and Goh [4] prove that the unit circle is part of the zero attractor of the polynomials \(Q_n(\zeta )\), and it follows from their results that asymptotic formulas for \(Q_n(\zeta )\) cannot be uniform on any subset of \(\mathbb {C}\) which is an open neighborhood of an arc of the unit circle.

Furthermore, note that taking \(\zeta \rightarrow 1\) in Theorem 1.3 does not recover the Hardy–Ramanujan asymptotic formula (1.2).

The above results can be further developed to linear combinations of p(abn) (where b is fixed). Each relevant combination \(\sum _{0 \le a < b} c_a p(a,b,n)\) corresponds to a polynomial \(P(x) := \sum _{0 \le j < b} c_a x^a\) via \(p(a,b,n) \mapsto x^a\). Perhaps the most combinatorially interesting cases are \(c_a \in \{0, \pm 1 \}\); i.e., differences of partition numbers. This means that for any two nonempty disjoint subsets \(S_1, S_2 \subset [0, b-1]\) of integers, we consider the differences

$$\begin{aligned} \sum _{a \in S_1} p(a,b,n) - \sum _{a \in S_2} p(a,b,n). \end{aligned}$$

The asymptotic behavior of these differences is described in Theorem 3.7. When choosing the coefficients \(c_a\) properly we can reduce the growth of the difference terms by canceling main terms. By doing so, we see that actually all formulas of Theorem 1.3 are required (as well as the sporadic cases described in Theorem 3.2). In contrast, one can deduce formula (1.3) by only elementary means without a thorough analysis of the coefficients \(Q_n(\zeta )\).

Moreover, for families of partition numbers, one can consider growth and sign changes simultaneously. Of special interest here is the fact that any shift of \((S_1, S_2)\) to \((S_1+r,S_2+r)\) changes the “phase” but not the “amplitude” of the asymptotic terms. The following example demonstrates this fact.

Example 1.5

Let \(b = 12\). For the sets \(S_1 := \{1,2,5\}\) and \(S_2 := \{0,3,4\}\), we find \(P_{S_1, S_2}(x) = x^5-x^4-x^3+x^2+x-1= (x-1)\Phi _{12}(x)\), where \(\Phi _{12}(x)\) is the 12th cyclotomic polynomial. The corresponding difference of partition numbers is

$$\begin{aligned} p(5,12,n) - p(4,12,n) - p(3,12,n) + p(2,12,n) + p(1,12,n) - p(0,12,n). \end{aligned}$$

By shifting the sets with integers \(0 \le r \le 6\), we find that, more generally, all differences

$$\begin{aligned} \Delta _r(n)&:= p(5+r,12,n) - p(4+r,12,n) - p(3+r,12,n)\\&\quad + p(2+r,12,n) + p(1+r,12,n) - p(r,12,n) \end{aligned}$$

have the same growth in their amplitudes but have different phases of sign changes. Since \( P_{S_1, S_2}(x)\) has zeros \(\{1, \pm \zeta _{12}, \pm \zeta ^5_{12}\}\), the dominating term in the asymptotic expansion is induced by the root of unity \(\zeta _6\). In fact, we obtain

$$\begin{aligned} \frac{\Delta _r(n)}{An^{-\frac{3}{4}}\exp \left( 2\lambda _1 \sqrt{n}\right) } = \cos \left( \alpha - \frac{2\pi r}{6} + 2\lambda _2 \sqrt{n} \right) + o(1), \end{aligned}$$
(1.5)

with \(\lambda _1 + i\lambda _2 = \sqrt{\mathrm {Li}_2(\zeta _6)}\), where \(A > 0\) and \(\alpha \in [0,2\pi )\) are defined by

$$\begin{aligned} Ae^{i\alpha } = \frac{\left( 1 - i\sqrt{3}\right) ^{\frac{3}{2}}}{12\sqrt{2\pi }} \mathrm {Li}_2(\zeta _6)^{\frac{1}{4}}. \end{aligned}$$

Note that A, \(\alpha \), \(\lambda _1\) and \(\lambda _2\) all do not depend on the choice of r. One can then asymptotically describe the regions of n, where

$$\begin{aligned} p(5,12,n) + p(2,12,n) + p(1,12,n) > p(4,12,n) + p(3,12,n) + p(0,12,n), \end{aligned}$$

and vice versa, using formula (1.5). Additionally, since \(\mathrm {Re}(\sqrt{\mathrm {Li}_2(\zeta _6)}) < \mathrm {Re}(\sqrt{\mathrm {Li}_2(\zeta _{12})})\), we note with the help of Theorem 1.2 that

$$\begin{aligned} \limsup _{n \rightarrow \infty } \left| \frac{p(a_1, 12, n) - p(a_2, 12, n)}{n^{-\frac{3}{4}}\exp \left( 2\mathrm {Re}(\mathrm {Li}_2(\zeta _6))\sqrt{n}\right) }\right| = \infty . \end{aligned}$$

This implies some form of cancellation within the higher differences \(\Delta _r(n)\), that “exceeds” that of simple differences modulo 12.

In contrast to Example 1.5, when b is prime, one cannot decrease the order of growth below simple differences using any rational combination of the p(abn). This is shown in Section 3.

The paper is organized as follows. In Section 2, we collect some classic analytical tools and prove some key lemmas. This includes a careful study of the dilogarithm function \(\mathrm {Li}_2(z)\) for values \(|z|=1\). In Section 3, we state our main result, Theorem 3.2 and applications. We prove Theorem 3.2 in Sections 4 and 5 using the circle method. Section 5 deals with the primary difficulty of bounding the minor arcs.

The first author is partially supported by the SFB/TRR 191 “Symplectic Structures in Geometry, Algebra and Dynamics”, funded by the DFG (Projektnummer 281071066 TRR 191).

The second author is partially supported by the Alfried Krupp prize.

2 Preliminaries

We will need several analytical results in this work, which we collect in this section. Much of the items here are discussed in works such as [9,10,11, 16, 19, 22]. The reader can skip this section and refer back to it as needed as we work through the proofs of our main theorems.

2.1 Classical asymptotic analysis and integration formulas

A first tool is the well-known Laplace’s method for studying limits of definite integrals with oscillation, which we will use for evaluating Cauchy-type integrals.

Theorem 2.1

(Laplace’s method, see Section 1.1.5 of [19]) Let \(A,B: [a,b]\rightarrow \mathbb {C}\) be continuous functions. Suppose \(x\ne x_0 \in [a,b]\) such that \(\mathrm {Re}(B(x))<\mathrm {Re}(B(x_0)),\) and that

$$\begin{aligned} \lim _{x\rightarrow x_0}\frac{B(x)-B(x_0)}{(x-x_0)^2} = -k\in \mathbb {C}, \end{aligned}$$

with \(\mathrm {Re}(k)>0.\) Then as \(t \rightarrow \infty \)

$$\begin{aligned} \int ^b_{a}A(x)e^{tB(x)}dx = e^{tB(x_0)}\left( A(x_0)\sqrt{\frac{\pi }{tk}}+o\left( \frac{1}{\sqrt{t}}\right) \right) . \end{aligned}$$

We are ultimately interested in how the coefficients of a series \(S(q):= \sum _{n\ge 0}a(n)q^n\) grow as \(n\rightarrow \infty \). The classical Euler–Maclaurin summation formulas can be applied in many cases to link the growth of a(n) to the growth of S(q) as q approaches the unit circle. We state the Euler–Maclaurin summation formulas in two different forms.

Theorem 2.2

(classical Euler–Maclaurin summation, see p. 66 of [16]) Let \(\{x\}:=x - \lfloor x \rfloor \) denote the fractional part of x. For \(N \in \mathbb {N}\) and \(f:[1, \infty ) \rightarrow \mathbb {C}\) a continuously differentiable function, we have

$$\begin{aligned} \sum _{1 \le n \le N} f(n)=\int _1^N f(x)dx+\frac{1}{2}(f(N)+f(1))+\int _1^N f'(x)\left( \{x\}-\frac{1}{2}\right) dx. \end{aligned}$$

We use a second formulation, due to Bringmann–Mahlburg–Jennings-Shaffer, to study the asymptotics of series with a complex variable approaching 0 within a fixed cone in the right-half plane. It is not stated in [10], but one can conclude from the proof that Theorem 2.3 is uniform in \(0 \le a \le 1.\)

Theorem 2.3

(uniform complex Euler–Maclaurin summation, [10], Theorem 1.2) Suppose \(0\le \theta < \frac{\pi }{2}\) and suppose that \(f:\mathbb {C}\rightarrow \mathbb {C}\) is holomorphic in a domain containing \(\{re^{i\alpha }: |\alpha | \le \theta \}\) with derivatives of sufficient decay; i.e., there is an \(\varepsilon >0\) such that for all m \(f^{(m)}(z) \ll z^{-1-\varepsilon }\) as \(z \rightarrow \infty \). Then uniformly for \(a \in [0,1]\), we have

$$\begin{aligned} \sum _{\ell \ge 0} f(w(\ell +a))=\frac{1}{w}\int _0^{\infty } f(w)dw -\sum _{n=0}^{N-1} \frac{f^{(n)}(0)B_{n+1}(a)}{(n+1)!}w^n+O_N\left( w^{N}\right) , \end{aligned}$$

uniformly as \(w \rightarrow 0\) in \(\mathrm {Arg}(w)\le \theta \).

To identify a constant term in our asymptotic formula, we cite the following integral calculation of Bringmann, Craig, Males and Ono.

Lemma 2.4

([8], Lemma 2.3) For \(a \in \mathbb {R}^+,\)

$$\begin{aligned} \int _0^{\infty } \left( \frac{e^{-ax}}{x(1-e^{-x})}-\frac{1}{x^2}-\left( \frac{1}{2}-a \right) \frac{e^{-ax}}{x} \right) dx =\log \left( \Gamma \left( a \right) \right) +\left( \frac{1}{2}-a\right) \log \left( a \right) -\frac{1}{2}\log (2\pi ). \end{aligned}$$

Finally, we will use Abel partial summation extensively when bounding the twisted eta-products on the minor arcs.

Proposition 2.5

(Abel partial summation, see p. 3 of [23]) Let \(N \in \mathbb {N}_0\) and \(M \in \mathbb {N}\). For sequences \(\{a_n\}_{n \ge N}\), \(\{b_n\}_{n \ge N}\) of complex numbers, if \(A_n:=\sum _{N < m \le n} a_m,\) then

$$\begin{aligned} \sum _{N< n \le N+M} a_nb_n=A_{N+M}b_{N+M}+\sum _{N< n < N+M} A_n(b_n-b_{n+1}). \end{aligned}$$

2.2 Elementary bounds

The following bound for differences of holomorphic functions will be used in conjunction with Abel partial summation during the course of the circle method. The proof of the following is a straightforward application of the fundamental theorem of calculus and the maximum modulus principle.

Lemma 2.6

Let \(f : U \rightarrow \mathbb {C}\) be a holomorphic function and \(\overline{B_r(c)} \subset U\) a compact disk. Then, for all \(a,b \in B_r(c)\) with \(a \not = b\), we have

$$\begin{aligned} \left| f(b) - f(a)\right| \le \max _{|z - c|=r} |f'(z)| |b-a|. \end{aligned}$$

We also need the following elementary maximum; for a proof see [18], Lemma 5.2.

Lemma 2.7

For \(a \in \left( -\frac{\pi }{2}, \frac{\pi }{2}\right) \) and \(b \in \mathbb {R}\), we have

$$\begin{aligned} \mathrm {Re}\left( \frac{e^{ia}}{1+ib} \right) \le \cos ^2\left( \frac{a}{2}\right) , \end{aligned}$$

with equality if and only if b satisfies \(\mathrm {Arg}(1+ib)=\frac{a}{2}.\)

2.3 Bounds for trigonometric series and the polylogarithm

We recall that for complex numbers s and z with \(|z| < 1\) the polylogarithm \(\mathrm {Li}_s(z)\) is defined by the series

$$\begin{aligned} \mathrm {Li}_s(z) := \sum _{n \ge 1} \frac{z^n}{n^s}. \end{aligned}$$

We are especially interested in the case \(s=2\), where \(\mathrm {Li}_2(z)\) is called the dilogarithm. The appendix of a recent preprint of Boyer and Parry [7] contains many useful results on the dilogarithm, including the following key lemma.

Lemma 2.8

(Proposition 4, [7]) The function \(\theta \mapsto \mathrm {Re} \left( \sqrt{\text {Li}_2(e^{2\pi i \theta })}\right) \) is decreasing on the interval \([0,\frac{1}{2}].\)

We also need to consider the derivative of the function \(\theta \mapsto \mathrm {Li}_2(e^{2\pi i\theta })\) and its partial sums. Let

$$\begin{aligned} G_M(\theta ) := \sum _{1 \le m \le M} \frac{e^{2\pi i\theta m}}{m}. \end{aligned}$$

Then the following bound holds.

Lemma 2.9

We have, uniformly for \(0< \theta < 1\),

$$\begin{aligned} \left| G_M(\theta )\right| \ll \log \left( \frac{1}{\theta }\right) + \log \left( \frac{1}{1-\theta }\right) , \qquad M \rightarrow \infty . \end{aligned}$$

Proof

Note that we have

$$\begin{aligned} G_M(\theta ) = \sum _{1 \le m \le M} \frac{\cos (2\pi \theta m)}{m} + i \sum _{1 \le m \le M} \frac{\sin (2\pi \theta m)}{m}, \end{aligned}$$

and as it is well known that \(\sum _{1 \le m \le M} \frac{\sin (2\pi \theta m)}{m}\) is uniformly bounded in \(\mathbb {R}\) (see [21] on p. 94) we are left with the cosine sum. Let \(0 < \theta \le \frac{1}{2}\) and \(M \in \mathbb {N}\). Consider the meromorphic function

$$\begin{aligned} h_\theta (z) := \frac{\cos (2\pi \theta z)(\cot (\pi z)-i)}{2iz}, \end{aligned}$$

together with the rectangle \(R_M\) with vertices \(\frac{1}{2}-iM,\frac{1}{2}+ \frac{i}{\theta }\), \(\frac{i}{\theta } + M + \frac{1}{2}\), and \(-iM + M + \frac{1}{2}\). Notice that in a punctured disk of radius \(r<1\) centered at \(k\ge 1\), we have

$$\begin{aligned} h_\theta (z) = \frac{\cos (2\pi \theta k)}{2ik}\left( \frac{1}{\pi (z-k)}-i+O(z-k)\right) . \end{aligned}$$

With the residue theorem we find

$$\begin{aligned} \oint _{\partial R_M} h_\theta (z) dz = 2\pi i \sum _{1 \le m \le M} \mathrm {Res}_{z=m} h_\theta (z) = \sum _{1 \le m \le M} \frac{\cos (2\pi \theta m)}{m}, \end{aligned}$$

where the contour is taken once in positive direction. By the invariance of the function under the reflection \(\theta \rightarrow 1 - \theta \), it suffices to consider values \(0 < \theta \le \frac{1}{2}\). A straightforward calculation shows that the bottom side integrals are bounded uniformly in \(0 < \theta \le \frac{1}{2}\). Similarly, also using that \(\cot (\pi z)\) is uniformly bounded on lines \(\{\mathrm {Re}(z) \in \frac{1}{2} \mathbb {Z}\setminus \mathbb {Z}\}\) for the second part, one argues

$$\begin{aligned} \int _{M+\frac{1}{2}-Mi}^{M+\frac{1}{2} + \frac{i}{\theta }} h_\theta (z)dz = O(1) + \int _{M+\frac{1}{2}}^{M+\frac{1}{2} + \frac{i}{\theta }} h_\theta (z)dz \ll \int _{\frac{1}{2}}^{\frac{1}{2}+\frac{i}{\theta }} \left| \frac{dz}{z+M}\right| \ll \log \left( \frac{1}{\theta }\right) . \end{aligned}$$

A similar argument yields

$$\begin{aligned} \int _{\frac{1}{2}+\frac{i}{\theta }}^{\frac{1}{2} - Mi} h_\theta (z) dz \ll \log \left( \frac{1}{\theta } \right) . \end{aligned}$$

For the rectangle top, note with the use of the substitution \(z \mapsto \frac{z}{\theta }\) we have

$$\begin{aligned} \int _{M + \frac{1}{2} + \frac{i}{\theta }}^{\frac{1}{2}+\frac{i}{\theta }} h_\theta (z) dz = \int _{\theta \left( M + \frac{1}{2}\right) +i}^{\frac{\theta }{2}+i} \frac{\cos (2\pi z) (\cot \left( \frac{\pi z}{\theta }\right) +i)}{z} dz-2i \int _{\theta \left( M + \frac{1}{2}\right) +i}^{\frac{\theta }{2}+i}\frac{\cos (2\pi z)}{z} dz. \end{aligned}$$
(2.1)

With the Residue Theorem we obtain

$$\begin{aligned} \int _{\frac{\theta }{2}+i}^{\theta (M+\frac{1}{2}) + i} = \int _{\frac{\theta }{2}+i}^{i\infty } + \int _{\theta (M+\frac{1}{2}) + i\infty }^{\theta (M+\frac{1}{2}) + i}. \end{aligned}$$

and the bound \(\cos (2\pi z)(\cot \left( \frac{\pi z}{\theta }\right) +i)= O(e^{-2\pi \mathrm {Im}(z)})\) as \(\mathrm {Im}(z) \rightarrow \infty \) (since \(0 < \theta \le \frac{1}{2}\)) yields the uniform boundedness of the first integral in (2.1). The integral on the right-hand side of (2.1) can be bounded via standard contour integration, for instance, by using that \(\int _\alpha ^\infty \frac{\cos (x)}{x} dx \ll 1\) for all \(\alpha \ge 1\). This completes the proof. \(\square \)

Lemma 2.9 has the following important consequence.

Lemma 2.10

Let a, b, h and k be positive integers, such that \(\gcd (a,b) = \gcd (h,k) = 1\). We assume that a and b are fixed. Then we have

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le j \le k \\ ak+bjh \not \equiv 0 \pmod {bk} \end{array}} \max _{m \ge 1} \left| G_m\left( \frac{a}{b} + \frac{hj}{k}\right) \right| = O(k), \end{aligned}$$

as \(k \rightarrow \infty \), uniformly in h.

Proof

The assumption \(\gcd (h,k)=1\) implies that the map \(j \mapsto hj\) is a bijection modulo k. One can show by elementary means that there is at most one \(j_0\) such that bk divides \(ak+bj_0h\). First, we assume that such a \(j_0\) exists. Using \(G_m(x+1)=G_m(x)\), we first reorder the sum, then apply Lemma 2.9 to obtain

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le j \le k \\ j \not = j_0 \end{array}} \max _{m \ge 1} \left| G_m\left( \frac{a}{b} + \frac{hj}{k}\right) \right| = \sum _{1 \le j \le k-1} \max _{m \ge 1} \left| G_m\left( \frac{j}{k}\right) \right|&\ll \sum _{1 \le j \le k-1} \left( \log \left( \frac{k}{j}\right) +\log \left( \frac{k}{k-j}\right) \right) \\ {}&= O(k) \end{aligned}$$

by Stirling’s formula. Now, assume that there is no such \(j_0\). In this case we find \(0< \alpha _{a,b,k} < b\), such that

$$\begin{aligned}&\sum _{1 \le j \le k} \max _{m \ge 1} \left| G_m\left( \frac{a}{b}+\frac{hj}{k}\right) \right| =\max _{m \ge 1} \left| G_m\left( \frac{\alpha _{a,b,k}}{bk}\right) \right| +\max _{m \ge 1} \left| G_m\left( \frac{\alpha _{a,b,k}}{bk}+1-\frac{1}{k}\right) \right| \\&\quad + \sum _{1 \le j \le k-2} \max _{m \ge 1} \left| G_m\left( \frac{\alpha _{a,b,k}}{bk}+\frac{j}{k}\right) \right| . \end{aligned}$$

Using again Lemma 2.9 and Stirling’s formula, we obtain

$$\begin{aligned} \sum _{1 \le j \le k-2} \max _{m \ge 1} \left| G_m\left( \frac{\alpha _{a,b,k}}{bk}+\frac{j}{k}\right) \right|&\ll \sum _{1 \le j \le k-2} \left( \log \left( \frac{k}{j}\right) +\log \left( \frac{k}{k-j}\right) \right) = O(k). \end{aligned}$$

Since clearly

$$\begin{aligned} \max _{m \ge 1} \left| G_m\left( \frac{\alpha _{a,b,k}}{bk}\right) \right| + \max _{m \ge 1} \left| G_m\left( \frac{\alpha _{a,b,k}}{bk}+1-\frac{1}{k}\right) \right| = O(\log (k)), \end{aligned}$$

the lemma follows. \(\square \)

3 Main results and applications

3.1 Twisted eta-products

In this section, we record the general asymptotic formula for \(Q_n(\zeta )\) where \(\zeta \) is any root of unity. Note that \(\overline{Q_n(\zeta )}=Q_n(\overline{\zeta })\), so it suffices to find asymptotic formulas for \(\zeta \) in the upper-half plane. The following theorem of Boyer and Goh [4] regarding the dilogarithm distinguishes several cases in our main theorem. Following [4], we define

$$\begin{aligned} \Psi _k(\theta ):=\mathrm {Re}\left( \frac{\sqrt{\mathrm {Li}_2(e^{ik \theta })}}{k}\right) , \qquad \text {for}\, 0 \le \theta \le \pi , \end{aligned}$$

and

$$\begin{aligned} 0<\theta _{13}<\frac{2\pi }{3}<\theta _{23}<\pi \end{aligned}$$

where each \(\theta _{jk}\) is a solution to \(\Psi _j\left( \theta \right) =\Psi _k\left( \theta \right) \). Here,

$$\begin{aligned} \theta _{13}=2.06672\dots , \quad \theta _{23}=2.36170\dots . \end{aligned}$$

Since the values \(\theta _{13}\) and \(\theta _{23}\) arise as solutions to a non-algebraic equation, it is very unlikely that they are rational multiples of \(\pi \). Therefore, we will no longer consider them in future investigations.

Theorem 3.1

([4], discussion prior to Theorem 2) For \(0\le \theta \le \pi \), we have

$$\begin{aligned} \max _{k \ge 1} \Psi _k(\theta )={\left\{ \begin{array}{ll} \Psi _1(\theta ) &{} \text {if}\, \theta \in [0,\theta _{13}], \\ \Psi _2(\theta ) &{} \text {if}\, \theta \in [\theta _{23},\pi ],\\ \Psi _3(\theta ) &{} \text {if}\, \theta \in [\theta _{13},\theta _{23}].\end{array}\right. } \end{aligned}$$

Following [18], define

$$\begin{aligned} \omega _{h,k}(z):=\prod _{j=1}^k \left( 1-z \zeta _k^{-jh}\right) ^{\frac{j}{k}-\frac{1}{2}}. \end{aligned}$$

We have the following asymptotic formulas.

Theorem 3.2

(1) If \(2\pi \frac{a}{b}\in (0,\theta _{13}),\) then

$$\begin{aligned} Q_n\left( \zeta _b^a\right) \sim \frac{\sqrt{1-\zeta _b^a}\mathrm {Li}_2\left( \zeta _b^a\right) ^{\frac{1}{4}}}{2\sqrt{\pi }n^{\frac{3}{4}}}\exp \left( {2\sqrt{\mathrm {Li}_2\left( \zeta _b^a\right) }\sqrt{n}}\right) , \qquad n \rightarrow \infty . \end{aligned}$$

(2) If \(2\pi \frac{a}{b}\in (\theta _{23},\pi ),\) then

$$\begin{aligned} Q_n\left( \zeta _b^a\right) \sim \frac{(-1)^n\sqrt{1-\zeta _b^a}\mathrm {Li}_2\left( \zeta _b^{2a}\right) ^{\frac{1}{4}}}{2\sqrt{2\pi }n^{\frac{3}{4}}}\exp \left( {\sqrt{\mathrm {Li}_2\left( \zeta _b^{2a}\right) }\sqrt{n}}\right) , \qquad n \rightarrow \infty . \end{aligned}$$

(3) If \(2\pi \frac{a}{b}\in (\theta _{13},\theta _{23})\setminus \left\{ \frac{2\pi }{3}\right\} ,\) then

$$\begin{aligned} Q_n\left( \zeta _b^a\right) \sim (\zeta _3^{-n}\omega _{1,3}(\zeta _b^{a})+\zeta _3^{-2n}\omega _{2,3}(\zeta _b^{a}))\frac{\mathrm {Li}_2(\zeta _b^{3a})^{\frac{1}{4}}}{2\sqrt{3\pi }n^{\frac{3}{4}}}\exp \left( \frac{2}{3}\sqrt{\mathrm {Li}_2(\zeta _b^{3a})}\sqrt{n}\right) , \quad n \rightarrow \infty . \end{aligned}$$

(4) We have

$$\begin{aligned} Q_n\left( \zeta _3\right) \sim \frac{\zeta _3^{-2n}(1- \zeta _3^2)^{\frac{1}{6}}(1- \zeta _3)^{\frac{1}{2}}\Gamma \left( \frac{1}{3}\right) }{2(6\pi n)^{\frac{2}{3}}}\exp \left( \frac{2\pi }{3}\sqrt{\frac{n}{6}}\right) , \qquad n \rightarrow \infty . \end{aligned}$$

We prove Theorem 3.2 in Sections 4 and 5.

Remark 3.3

Recall that we have the asymptotic formula (1.2) for \(Q_n(1)=p(n)\), whereas for \(Q_n(-1)\), standard combinatorial methods give

$$\begin{aligned} \sum _{n \ge 0} Q_n(-1)q^n=\frac{1}{(-q;q)_{\infty }}=\frac{\left( q;q\right) _{\infty }}{(q^2;q^2)_{\infty }}=\left( q;q^2\right) _{\infty }=\sum _{n \ge 0} (-1)^np_{\mathcal{DO}\mathcal{}}(n)q^n, \end{aligned}$$

where \(p_{\mathcal{DO}\mathcal{}}(n)\) counts the number of partitions of n into distinct odd parts. An asymptotic formula for \(p_{\mathcal{DO}\mathcal{}}(n)\) can be worked out using standard techniques. For example, Ingham’s Tauberian theorem (see [10], Theorem 1.1) with the modularity of the Dedekind \(\eta \)-function yields

$$\begin{aligned} Q_n(-1)=(-1)^np_{\mathcal{DO}\mathcal{}}(n) \sim \frac{(-1)^n}{2(24)^{\frac{1}{4}}n^{\frac{3}{4}}}\exp \left( \pi \sqrt{\frac{n}{6}}\right) . \end{aligned}$$

Note the lack of uniformity in the asymptotic formulas for \(\zeta \) near \(\pm 1\); in particular, the asymptotic formulas for \(Q_n(1)\) and \(Q_n(-1)\) cannot be obtained by taking \(\frac{a}{b} \rightarrow \pm 1\) in cases (1) and (2).

3.2 Applications to differences of partition functions

In this section, we apply Theorem 3.2 to differences of the partition functions p(abn), partitions of n with number of parts congruent to a modulo b. The following elementary proposition relates the numbers p(abn) to the coefficients \(Q_n( \zeta _b^{j})\).

Proposition 3.4

We have

$$\begin{aligned} p(a,b,n)=\frac{1}{b}\sum _{0 \le j \le b-1} \zeta _b^{-ja}Q_n\left( \zeta _b^{j}\right) . \end{aligned}$$

Proof

Using orthogonality, we can write the indicator functions of congruence classes as

$$\begin{aligned} 1_{x \equiv a \pmod {b}}= \frac{1}{b}\sum _{j=0}^{b-1} \zeta _b^{-ja} \zeta _b^{jx}, \end{aligned}$$

and by standard combinatorial techniques (see [1], Ch. 1) one has

$$\begin{aligned} Q_n(z)=\sum _{\lambda \vdash n} z^{\ell (\lambda )}. \end{aligned}$$

Hence,

$$\begin{aligned} p(a,b,n)=\sum _{\lambda \vdash n} \frac{1}{b}\sum _{0 \le j \le b-1} \zeta _b^{-ja} \zeta ^{j\ell (\lambda )}_{b}&=\frac{1}{b}\sum _{0 \le j \le b-1} \zeta _b^{-ja}\sum _{\lambda \vdash n} \left( \zeta _b^{j}\right) ^{\ell (\lambda )} =\frac{1}{b}\sum _{0 \le j \le b-1} \zeta _b^{-ja} Q_n\left( \zeta _b^{j}\right) , \end{aligned}$$

which completes the proof. \(\square \)

Thus, asymptotics for differences of p(abn) can be identified using the asymptotic formulas found for \(Q_n(\zeta )\) in Theorem 3.2, in particular the equidistribution of the largest part in congruence classes follows immediately: \(\frac{p(a,b,n)}{p(n)} \sim \frac{1}{b}.\) Furthermore, using the Hardy–Ramanujan–Rademacher exact formula for p(n) ( [1], Theorem 5.1) with Theorem 3.2, one can improve this in the various cases. For example, for \(b \ge 5,\) we have

$$\begin{aligned} \lim _{n \rightarrow \infty }\left( \frac{b\cdot p(a,b,n) - \frac{2\sqrt{3}}{24n-1}\exp \left( \frac{\pi \sqrt{24n-1}}{6}\right) \left( 1-\frac{6}{\pi \sqrt{24n-1}} \right) }{An^{-\frac{3}{4}}\exp (2\lambda _1\sqrt{n})} -\cos \left( \alpha -\frac{2\pi a}{b}+2\lambda _2\sqrt{n}\right) \right) =0, \end{aligned}$$

where \(\lambda _1+i\lambda _2=\sqrt{\mathrm {Li}_2( \zeta _b)},\) \(A \ge 0,\) and \(\alpha \in [0,2\pi )\) are defined by

$$\begin{aligned} Ae^{i\alpha }=\sqrt{\frac{(\lambda _1+i\lambda _2)(1- \zeta _b^a)}{\pi }}. \end{aligned}$$

We record a number of results below in the same vein. Considering simple differences, \(p(a_1,b,n)-p(a_2,b,n),\) it follows from Proposition 3.4 that when rewriting each p(abn) in terms of \(Q_n\) the two summands \(Q_n(1)=p(n)\) cancel. With a few exceptions for \(b=4\), the dominant terms are always \(Q_n(\zeta _b)\) and \(Q_n(\zeta _b^{b-1})\).

Theorem 3.5

Let \(0 \le a_1 < a_2 \le b-1.\)

(1) For \(b=2,\) we have \(p(0,2,n)-p(1,2,n)=Q_n(-1).\)

(2) For \(b=3\), we have

$$\begin{aligned} \frac{p(a_1,3,n)-p(a_2,3,n)}{A_{a_1,a_2}n^{-\frac{2}{3}}\exp \left( \frac{2\pi }{3}\sqrt{\frac{n}{6}}\right) } = \cos \left( \alpha _{a_1,a_2}-\frac{4\pi n}{3}\right) + o(1), \end{aligned}$$

where \(A_{a_1,a_2} \ge 0\) and \(\alpha _{a_1,a_2} \in [0,2\pi )\) are defined by

$$\begin{aligned} A_{a_1,a_2}e^{i\alpha _{a_1,a_2}}=( \zeta _3^{-a_1}- \zeta _3^{-a_2})(1- \zeta _3^{2})^{\frac{1}{6}}(1- \zeta _3)^{\frac{1}{2}}\frac{\Gamma \left( \frac{1}{3}\right) }{3(6\pi )^{\frac{2}{3}}}. \end{aligned}$$

(3) For \(b=4,\) and \(a_1,a_2\) of opposite parity, we have

$$\begin{aligned} p(a_1,4,n)-p(a_2,4,n) \sim \frac{(-1)^{a_1} - (-1)^{a_2}}{4}Q_n(-1). \end{aligned}$$

(4) For \(b \ge 5\), or for \(b=4\) and \(a_1,a_2\) of the same parity, we have

$$\begin{aligned} \frac{p(a_1,b,n)-p(a_2,b,n)}{B_{a_1,a_2,b}n^{-\frac{3}{4}}\exp (2\lambda _1\sqrt{n})}=\cos \left( \beta _{a_1,a_2,b}+2\lambda _2\sqrt{n} \right) + o(1), \end{aligned}$$

where \(\lambda _1+i\lambda _2=\sqrt{\mathrm {Li}_2( \zeta _b)}\), \(B_{a_1,a_2,b} \ge 0\) and \(\beta _{a_1,a_2,b} \in [0,2 \pi )\) are defined by

$$\begin{aligned} B_{a_1,a_2,b}e^{i\beta _{a_1,a_2,b}}=\frac{\left( \zeta _b^{-a_1}- \zeta _b^{-a_2}\right) }{b}\sqrt{\frac{(1- \zeta _b)(\lambda _1+i\lambda _2)}{\pi }}. \end{aligned}$$

Proof

When \(b=2\), Theorem 3.5 follows from Proposition 3.4. Let \(b \ge 5.\) By Proposition 3.4, it follows that

$$\begin{aligned} p(a_1,b,n)-p(a_2,b,n)=\frac{1}{b}\mathrm {Re}\left( (\zeta _b^{-a_1} - \zeta _{b}^{-a_2})Q_n( \zeta _b)\right) +\frac{1}{b}\sum _{1 \le j \le b-2} (\zeta _b^{-ja_1} - \zeta _b^{-ja_2})Q_n\left( \zeta _b^{j}\right) . \end{aligned}$$

Upon dividing both sides by \(B_{a_1,a_2,b} n^{-\frac{3}{4}} \exp (2\lambda _1\sqrt{n})\), Lemma 2.8 implies that the sum on the right is \(O(e^{-c\sqrt{n}})\), for some \(c>0,\) and it then follows from Theorem 3.2 that

$$\begin{aligned} \frac{p(a_1,b,n)-p(a_2,b,n)}{B_{a_1,a_2,b}n^{-\frac{3}{4}}\exp \left( 2\lambda _1\sqrt{n}\right) }=\mathrm {Re}\left( e^{i\left( \beta _{a_1,a_2,b}+2\lambda _2\sqrt{n}\right) }\right) +o(1)+o\left( e^{-c\sqrt{n}} \right) , \end{aligned}$$
(3.1)

which gives the claim of Theorem 3.5.

The other cases are proved similarly by noting that Lemma 2.8 and Theorem 3.2 imply that the \(Q_n( \zeta _b)\) and \(Q_n( \zeta _b^{-1})\) terms always dominate \(Q_n( \zeta _b^{j})\) for \(j \ne \pm 1,\) except in the case that \(b=4\), where \(Q_n(-1)\) dominates when \(a_1,a_2\) have opposite parity. But \(Q_n(-1)\) vanishes from the sum in Proposition 3.4 when \(b=4\) and \(a_1,a_2\) have the same parity, which leads to the third case in Theorem 3.5. \(\square \)

More generally, if \(P_{{\textbf {v}}}(x):=\sum _{0 \le a \le b-1} v_ax^a \in \mathbb {R}[x]\) with \({\textbf {v}}:= (v_0, \ldots ,v_{b-1})\in \mathbb {R}^b\), then Theorem 3.2 implies asymptotic formulas for any weighted count \( \sum _{a=0}^{b-1}v_ap(a,b,n). \) To state our general theorem, we let

$$\begin{aligned} L(e^{i\theta }):={\left\{ \begin{array}{ll}\sqrt{\mathrm {Li}_2(e^{i\theta })} &{} \text {if}\, 0 \le \theta< \theta _{13},\\ \frac{\sqrt{\mathrm {Li}_2(e^{3i\theta })}}{3} &{} \text {if}\, \theta _{13}< \theta< \theta _{23},\\ \frac{\sqrt{\mathrm {Li}_2(e^{2i\theta })}}{2} &{} \text {if}\, \theta _{23} < \theta \le \pi . \end{array}\right. } \end{aligned}$$

Let \(\mathcal {Z}(P_{{\textbf {v}}})\) be the roots of \(P_{{\textbf {v}}}\), and let \(\lambda _1+i\lambda _2=L( \zeta _b^{a_0})\) for \(a_0 \le \frac{b}{2}\), whenever

$$\begin{aligned} \mathrm {Re}\left( L( \zeta _b^{a_0})\right) =\max _{\begin{array}{c} 0 \le a \le \frac{b}{2} \\ \zeta _b^a\notin \mathcal {Z}(P_{{\textbf {v}}}) \end{array}} \mathrm {Re} \left( L( \zeta _b^a)\right) . \end{aligned}$$
Fig. 3
figure 3

\(\mathrm {Re}(L(e^{i\theta }))\) for \(0\le \theta \le \pi \)

Theorem 3.6

With notation as above, we have the following asymptotic formulas.

(1) If \(a_0=0,\) then \(\sum _{0 \le a \le b-1} v_ap(a,b,n) \sim \frac{P_{{\textbf {v}}}(1)}{b}p(n).\)

(2) If \(0< 2 \pi \frac{a_0}{b} < \theta _{13},\) then

$$\begin{aligned} \frac{\sum _{0 \le a \le b-1}v_ap(a,b,n)}{A_{a_0,b,{\textbf {v}}} n^{-\frac{3}{4}} \exp (2\lambda _1\sqrt{n})} = \cos \left( \alpha _{a_0,b,{\textbf {v}}}+2\lambda _2\sqrt{n} \right) + o(1), \end{aligned}$$

where \(A_{a_0,b,{\textbf {v}}} \ge 0\) and \(\alpha _{a_0,b,{\textbf {v}}} \in {[}0,2\pi )\) are defined by

$$\begin{aligned} A_{a_0,b,{\textbf {v}}} \cdot e^{i \alpha _{a_0,b,{\textbf {v}}}}= \frac{P_{{\textbf {v}}}( \zeta _b^{-a_0})}{b}\sqrt{\frac{(\lambda _1+i\lambda _2)(1- \zeta _b^{a_0})}{\pi }}. \end{aligned}$$

(3) If \(\theta _{13}< 2 \pi \frac{a_0}{b} < \theta _{23}\) and \(a_0 \ne \frac{b}{3},\) then

$$\begin{aligned}&\frac{\sum _{0 \le a \le b-1}v_ap(a,b,n)}{A_{a_0,b,{\textbf {v}}} n^{-\frac{3}{4}} \exp (2\lambda _1\sqrt{n})} = B_{a_0,b}\cos \left( \alpha _{a_0,b,{\textbf {v}}}+\beta _{a_0,b}-\frac{2\pi n}{3} + 2 \lambda _2\sqrt{n}\right) \\&\quad + C_{a_0,b}\cos \left( \alpha _{a_0,b,{\textbf {v}}}+\gamma _{a_0,b}-\frac{4\pi n}{3} + 2 \lambda _2\sqrt{n}\right) + o(1), \end{aligned}$$

where \(B_{a_0,b},C_{a_0,b} \ge 0\) and \(\beta _{a_0,b},\gamma _{a_0,b} \in [0,2\pi )\) are defined by

$$\begin{aligned} B_{a_0,b}e^{i\beta _{a_0,b}}= & {} \omega _{1,3}( \zeta _b^{a_0}),\\ C_{a_0,b}e^{i\gamma _{a_0,b}}= & {} \omega _{2,3}( \zeta _b^{a_0}). \end{aligned}$$

(4) If \(a_0=\frac{b}{3}\), then

$$\begin{aligned} \frac{b\sum _{0 \le a \le b-1}v_ap(a,b,n)}{D_{{\textbf {v}}} n^{-\frac{2}{3}} \exp \left( \frac{2\pi }{3}\sqrt{\frac{n}{6}}\right) } = \cos \left( \delta _{{\textbf {v}}}-\frac{4\pi n}{3}\right) + o(1), \end{aligned}$$

where \(D_{{\textbf {v}}} \ge 0\) and \(\delta _{{\textbf {v}}} \in [0,2\pi )\) are defined by

$$\begin{aligned} D_{{\textbf {v}}} \cdot e^{i\delta _{{\textbf {v}}}}=\frac{(1- \zeta _3^{2})^{\frac{1}{6}}(1- \zeta _3)^{\frac{1}{2}}\Gamma (\frac{1}{3})}{2(6\pi )^{\frac{2}{3}}}P_{{\textbf {v}}}\left( \zeta _3^{-1}\right) . \end{aligned}$$

(5) If \(\theta _{23}< 2 \pi \frac{a_0}{b} < \pi \), then

$$\begin{aligned} \frac{\sum _{0 \le a \le b-1}c_vp(a,b,n)}{A_{a_0,b,{\textbf {v}}} n^{-\frac{3}{4}}\exp \left( 2\lambda _1\sqrt{n}\right) } = \cos \left( \alpha _{a_0,b,{\textbf {v}}}+\pi n+2\lambda _2\sqrt{n} \right) + o(1). \end{aligned}$$

(6) If \(a_0=\frac{b}{2},\) then \(\sum _{0 \le a \le b-1} (-1)^a v_ap(a,b,n) \sim \frac{P_{{\textbf {v}}}(-1)}{b}Q_n(-1).\)

Proof

Theorem 3.6 is proved similarly to Theorem 3.5. For Cases (1) and (6), the asymptotic formula for \(Q_n(1) \sim p(n)\) and Proposition 3.4 directly implies

$$\begin{aligned} \sum _{0 \le a \le b-1} v_ap(a,b,n)&\sim \frac{1}{b}(v_0Q_n(1) + v_1Q_n(1)+ \cdots +v_{b-1}Q_n(1)) = \frac{P_{{\textbf {v}}}(1)p(n)}{b},\\ \sum _{0 \le a \le b-1}(-1)^a v_ap(a,b,n)&\sim \frac{1}{b}(v_0Q_n(-1) - v_1Q_n(-1)+ \cdots +(-1)^{b-1}v_{b-1}Q_n(-1)) \\&= \frac{P_{{\textbf {v}}}(-1)Q_n(-1)}{b}, \end{aligned}$$

for Cases (1) and (6), respectively.

For Cases (2), (3) and (5), the asymptotic main term (using that \(\overline{Q_n(\zeta )} = Q_n(\overline{\zeta })\)) is

$$\begin{aligned} p(a,b,n) \sim \frac{1}{b}\left( \zeta ^{-a_0 a}_bQ_n(\zeta ^{a_0}_b)+\overline{\zeta ^{-a_oa}_b{Q_n(\zeta ^{a_0}_b)}}\right) = \frac{2}{b}\mathrm {Re}\left( \zeta ^{-a_0 a}_bQ_n(\zeta ^{a_0}_b)\right) . \end{aligned}$$

The proof then follows by applying Theorem 3.2 and dividing by the appropriate normalizing factors in analog to Equation (3.1).

For case (4), there is only one main term in the sum for

$$\begin{aligned} p(a,b,n)\sim \zeta ^{-\frac{a}{3}}Q_n\left( \zeta ^{\frac{1}{3}}\right) . \end{aligned}$$

Applying Theorem 3.2 and the analog to Equation (3.1) again proves the claim. \(\square \)

One application of the above theorem generalizes Theorem 3.5 to differences of partitions with number of parts modulo b in one of two disjoint sets of residue classes \(S_1, S_2 \subset [0,b-1]\). That is, we consider

$$\begin{aligned} P_{S_1,S_2}(x):=\sum _{a \in S_1} x^a-\sum _{a \in S_2} x^a, \end{aligned}$$

and prove a more explicit version of Theorem 3.6 in this case. Since \(P_{S_1,S_2}(x)\) is a polynomial of degree at most \(b-1\) with integer coefficients, there must exist some \(d \mid b\) such that \( \zeta _d \notin \mathcal {Z}(P_{S_1,S_2});\) otherwise, \(P_{S_1,S_2}\) would be divisible by \(\prod _{d \mid b} \Phi _{d}(x)=x^b-1,\) where \(\Phi _d\) is the d-th cyclotomic polynomial, a contradiction.

Theorem 3.7

Let \(b \ge 2\) and let \(S_1, S_2 \subset [0,b-1]\) be disjoint subsets of integers. If \(|S_1| \ne |S_2|,\) then

$$\begin{aligned} \sum _{a \in S_1}p(a,b,n)-\sum _{a \in S_2}p(a,b,n) \sim \frac{(|S_1|-|S_2|)p(n)}{b}. \end{aligned}$$

Otherwise, if \(|S_1|=| S_2|\), then we have the following cases. Let \(d_0\) be the largest integer such that \(d_0 \mid b\) and \( \zeta _{d_0} \notin \mathcal {Z}(P_{S_1,S_2}).\)

(1) If \(d_0\ge 5\) or if \(d_0=4\) and \(-1 \in \mathcal {Z}(P_{S_1,S_2})\), then

$$\begin{aligned} \frac{\sum _{a \in S_1} p(a,b,n)-\sum _{a \in S_2} p(a,b,n)}{A_{d_0,S_1,S_2} n^{-\frac{3}{4}} \exp (2\lambda _1\sqrt{n})} = \cos \left( \alpha _{d_0,S_1,S_2}+2\lambda _2\sqrt{n}\right) + o(1), \end{aligned}$$

where \(\lambda _1+i\lambda _2=\sqrt{\mathrm {Li}_2( \zeta _{d_0})}\), \(A_{d_0,S_1,S_2}\ge 0\) and \(\alpha _{d_0,S_1,S_2} \in [0,2\pi )\) are defined by

$$\begin{aligned} A_{d_0,S_1,S_2} \cdot e^{i\alpha _{d_0,S_1,S_2}}=\frac{P_{S_1,S_2}\left( \zeta _{d_0}^{-1}\right) }{b}\sqrt{\frac{(\lambda _1+i\lambda _2)(1- \zeta _{d_0})}{\pi }}. \end{aligned}$$

(2) If \(d_0=4\) or 3 with b even, and \(-1 \notin \mathcal {Z}(P_{S_1,S_2})\), we have the following allowable sets:

  • If \(d_0 = 4\) and \((k_1+k_2)\not \equiv 0 \pmod {2}\),

    $$\begin{aligned} S_1\times S_2&= \{a: a\le b-1, \; a\equiv k_1 \pmod {4}\}\times \{a: a\le b-1, \; a\equiv k_2 \pmod {4}\}. \end{aligned}$$
  • If \(d_0=3\), b is even and \(k_1 \not \equiv k_2 \pmod {2},\)

    $$\begin{aligned} S_1\times S_2&= \{a: a\le b-1,\; a\equiv k_1 \pmod {2}\}\times \{a: a\le b-1,\; a\equiv k_2 \pmod {2}\}. \end{aligned}$$

The asymptotic formulas are then given by

$$\begin{aligned} \sum _{a \in S_1}p(a,b,n)-\sum _{a \in S_2} p(a,b,n) \sim \frac{N_{S_1,S_2}}{b}Q_n(-1), \end{aligned}$$

where

$$\begin{aligned} N_{S_1,S_2}={\left\{ \begin{array}{ll} (-1)^{k_1}b&{} \text {if}\;d_0=3,\; b \; \text {even},\\ (-1)^{k_1}\frac{b}{2} &{} \text {if}\;d_0=4.\end{array}\right. } \end{aligned}$$

(3) If \(d_0=3\), b is even and \(-1 \in \mathcal {Z}(P_{S_1,S_2})\), or \(d_0=3\) and b is odd, we have the following sets \(S_1\) and \(S_2\):

  • If b is odd, \(S_1\) and \(S_2\) must contain distinct residue classes modulo 3.

  • If b is even,

    $$\begin{aligned} S_1\times S_2&= \{a: a\le b-1,\; a\equiv k_1 \;\text {or}\; k_2 \pmod {6}\}\times \{a: a\le b-2,\; a\equiv k_3\; \text {or}\; k_4 \pmod {6}\}, \end{aligned}$$

    where

    $$\begin{aligned} (k_1,k_2,k_3,k_4)&= (0,3,2,5),\; (2,5,0,3),\; (1,4,2,5),\; (2,5,1,4), (1,3,1,4),\; \text {or}\; (1,4,1,3). \end{aligned}$$

The asymptotic formula is then given by

$$\begin{aligned} \sum _{a \in S_1} p(a,b,n)-\sum _{a \in S_2} p(a,b,n) \sim \frac{2}{b}\mathrm {Re}\left( Q_n(\zeta _3)P_{S_1,S_2}\left( \zeta ^{-1}_3\right) \right) . \end{aligned}$$

(4) If \(d_0=2,\) then for some \(a_1, a_2\) of opposite parity we have

$$\begin{aligned} (S_1,S_2)=\{a \equiv a_1 \pmod {2}\} \times \{a \equiv a_2 \pmod {2}\} \end{aligned}$$

and

$$\begin{aligned} \sum _{a \in S_1}p(a,b,n)-\sum _{a \in S_2} p(a,b,n) \sim (-1)^{a_1}Q_n(-1). \end{aligned}$$

Proof sketch of Theorem 3.7

The asymptotic analysis is similar to the proof of Theorem 3.5, since Lemma 2.8 and Theorem 3.2 imply that the sequence \(Q_n( \zeta _d)\), ranked from in asymptotic order from least to greatest, is

$$\begin{aligned} Q_n( \zeta _3), \ Q_n(i), \ Q_n(-1), \ Q_n(\zeta _5), \ Q_n(\zeta _6), \dots , Q_n(1)=p(n). \end{aligned}$$

Thus, for example in case (3), the asymptotic behavior of \(\sum _{a \in S_1} p(a,b,n) - \sum _{a \in S_2} p(a,b,n)\) is determined by \(Q_n( \zeta _3)\) and \(Q_n( \zeta _3^{-1})\) since all other \(Q_n( \zeta _b^a)\) vanish in \(P_{S_1,S_2}( \zeta _{b}^{-j})Q_n( \zeta _b^{j})\). Furthermore, in this case we must have

$$\begin{aligned} \frac{x^{b}-1}{\Phi _3(x)} \mid P_{S_1,S_2}(x), \end{aligned}$$

and \(\deg (P_{S_1,S_2}(x))\le b-1\). Since

$$\begin{aligned} \frac{x^{b}-1}{\Phi _3(x)}=x^{b-2}-x^{b-3}+x^{b-5}-x^{b-6}+ \dots + x^{4}-x^3+x-1, \end{aligned}$$

this leads directly to the possible sets \(S_1\) and \(S_2\) described in case 3. Finally, note that, given \(S_1\) and \(S_2\) defined in terms of \(a_1\) and \(a_2\) modulo b, we have

$$\begin{aligned} P_{S_1,S_2}\left( \zeta _3^{-1}\right) =\sum _{\begin{array}{c} 0 \le a \le b \\ a \equiv a_1 \pmod {3} \end{array}} \zeta _{3}^{-a}-\sum _{\begin{array}{c} 0 \le a \le b \\ a \equiv a_2 \pmod {3} \end{array}} \zeta _{3}^{-a}=\frac{b}{3}( \zeta _3^{-a_1}- \zeta _3^{-a_2}). \end{aligned}$$

This is taken into account in the definition of the constant \(B_{S_1,S_2}.\) The other cases are proved similarly. \(\square \)

We make a few remarks.

Remark 3.8

(1) Theorem 3.7 case (1), in combination with Lemma 2.8, shows that one can reduce the growth of the amplitudes in the differences exponentially, as long as the corresponding polynomial \(P_{S_1, S_2}\) vanishes at the crucial roots of unity. But the options for such types of cancellation strongly depend on b. For example, if b is a prime number, there is not even a rational combination (except for the trivial combination) such that the amplitudes of \(\sum _{0 \le a < b} v_a p(a,b,n)\) grow exponentially less than any simple difference \(p(a_1,b,n) - p(a_2,b,n)\). The simple algebraic reason behind this is that the minimal polynomial of \(\zeta _b\) has degree \(b-1\) in this case. It would be interesting to find a purely combinatorial interpretation for this fact.

(2) Note that if we shift the residue classes in \(S_1\) and \(S_2\) by some integer r and then take least residues modulo b to compute \(P_{S_1+r,S_2+r}(x)\), then this polynomial has the same roots of unity as \(P_{S_1,S_2}(x)\), and so

$$\begin{aligned} \sum _{a \in S_1+r}p(a,b,n)-\sum _{a \in S_2+r}p(a,b,n) \end{aligned}$$

always has the same asymptotic behavior in Theorem 3.7 as \(\sum _{a \in S_1}p(a,b,n)-\sum _{a \in S_2}p(a,b,n).\) At the same time, the phase in the cosine changes. Indeed, we obtain

$$\begin{aligned} \frac{\sum _{a \in S_1+r} p(a,b,n)-\sum _{a \in S_2+r} p(a,b,n)}{A_{d_0,S_1,S_2} n^{-\frac{3}{4}}\exp \left( 2\lambda _1\sqrt{n}\right) } = \cos \left( \alpha _{d_0,S_1,S_2} - \frac{2\pi r}{d_0} +2\lambda _2\sqrt{n}\right) + o(1), \end{aligned}$$
(3.2)

where all the constants are the same as in Theorem 3.7 (1). One can further use trigonometric identities to obtain a wider class of more classical asymptotic formulas, for instance regarding squared partition differences. Indeed, if \(4|d_0\) in (3.2), one finds using \(\sin ^2(x) + \cos ^2(x) = 1\), as \(n \rightarrow \infty \),

$$\begin{aligned}&\left( \sum _{a \in S_1} p(a,b,n)-\sum _{a \in S_2} p(a,b,n) \right) ^2 + \left( \sum _{a \in S_1+\frac{d_0}{4}} p(a,b,n)-\sum _{a \in S_2+\frac{d_0}{4}} p(a,b,n) \right) ^2 \\&\quad \sim A_{d_0,S_1,S_2}^2 n^{-\frac{3}{2}}\exp \left( 4\lambda _1\sqrt{n}\right) . \end{aligned}$$

(3) Cases 3 and 4 in Theorem 3.7 show that for \(d_0\in \{2,3\}\), there are finitely many sets \(S_1\) and \(S_2\) such that the asymptotic behavior of \(\sum _{a \in S_1}p(a,b,n)-\sum _{a \in S_2}p(a,b,n)\) is determined by \(Q_n( \zeta _{d_0})\), and that the number of such sets is independent of b. In fact this is true for any \(d_0\), and we leave it as an open problem to describe the sets \(S_1,S_2\) in general. The sets \(S_1\) and \(S_2\) need not each consist of one congruence class each modulo \(d_0,\) for example with \(b=10\), the polynomial \(P_{\{1,3,6,8\},\{0,2,5,7\}}(x)\) has \(d_0=5.\)

3.3 Examples

In this section, we provide some examples.

Example 3.9

Let \(b=6\), and consider the difference \(p(1,6,n) - p(5,6,n)\). Then according to Theorem 3.5, we obtain

$$\begin{aligned} \frac{p(1,6,n) - p(5,6,n)}{Bn^{-\frac{3}{4}} \exp \left( 2\lambda _1 \sqrt{n}\right) } = \cos \left( \beta + 2\lambda _2 \sqrt{n}\right) + o(1), \end{aligned}$$
(3.3)

where \(\lambda _1 + i\lambda _2 = \sqrt{\mathrm {Li}_2(\zeta _6)}\), and \(B > 0\) and \(\beta \in [0, 2\pi )\) are given implicitly by

$$\begin{aligned} Be^{i\beta } = \frac{\zeta _6^{-1} - \zeta _6^{-5}}{6} \sqrt{\frac{(1-\zeta _6) (\lambda _1 + i \lambda _2)}{\pi }} = \frac{i}{\sqrt{12 \pi }} \sqrt{\left( \frac{1}{2} - i\frac{\sqrt{3}}{2}\right) \sqrt{\mathrm {Li}_2(\zeta _6)}}. \end{aligned}$$

Note that this implies (choosing B to be the absolute value of the right-hand side of the equation above)

$$\begin{aligned} \lambda _1&= 0.81408 \ldots , \qquad \lambda _2 = 0.62336 \ldots , \nonumber \\ B&= 0.23268 \ldots , \qquad \beta = 1.37394 \ldots . \end{aligned}$$
(3.4)

Considering the first 900 coefficients numerically yields

$$\begin{aligned} M := \{7, 26, 59, 104, 162, 233, 316, 412, 521, 642, 776, \ldots \}, \end{aligned}$$

which are the highest indices until a change of signs in the sequence \(p(1,6,n) - p(5,6,n)\). We can compare this exact result to the prediction of formula (3.3). By considering the roots of the cosine, we find that it changes signs approximately at

$$\begin{aligned} M' := \{7, 27, 59, 104, 162, 233, 316, 412, 521, 642, 777, \ldots \}. \end{aligned}$$

Note that in the first eleven cases, only case two with 27 and case eleven with 777 give slightly wrong predictions (Figs. 3 and 4).

Fig. 4
figure 4

The plot shows the sign changes of \(p(1,6,n)-p(5,6,n)\) (in blue dots) and the estimated sign changes (the red line)

The next example refers to higher differences of partition functions.

Example 3.10

Again, we consider the case \(b=6\). In the spirit of Theorem 3.7 we want to consider multi-termed differences. To do so, we need two subsets \(S_1, S_2 \subset \mathbb {Z}/6\mathbb {Z}\), such that the corresponding nontrivial polynomial \(P_{S_1, S_2}(x)\) of degree at most 5 vanishes at as many roots of unity around \(x=1\) as possible. We first note that

$$\begin{aligned} (x-1)\Phi _6(x) = (x-1)\left( x^2 - x + 1\right) = x^3 - 2x^2 + 2x - 1. \end{aligned}$$

In this case, we obtain a weighted difference and no subsets can be found for a growth reduction to an exponent induced by \(\mathrm {Li}_2(\zeta _3)\). We continue by trying to eliminate also the 3rd roots of unity; i.e., with

$$\begin{aligned} (x-1)\Phi _6(x)\Phi _3(x) = x^5 - x^4 + x^3 - x^2 + x - 1. \end{aligned}$$

This is exactly the case (4) of Theorem 3.7. As a result, setting \(S_1 := \{1,3,5\}\) and \(S_2 := \{0,2,4\}\), we find, as \(n \rightarrow \infty \),

$$\begin{aligned} \sum _{0 \le a \le 5} (-1)^{a+1} p(a,6,n) \sim - Q_n(-1) \sim \frac{(-1)^{n+1}}{2(24)^{\frac{1}{4}} n^{\frac{3}{4}}} \exp \left( \pi \sqrt{\frac{n}{6}}\right) . \end{aligned}$$

Also note that \(\frac{\pi }{\sqrt{6}} = 1.2825 \ldots \) is much smaller than the exponent \(2\lambda _1 = 1.6281 \ldots \) in (3.3), compare also (3.4).

Finally, we give an application of Remark 3.8.

Example 3.11

In light of Equation (3.2), we can choose r such that the cosine becomes a sine on the right-hand side. Using Pythagoras’ Theorem, and considering the case \(b=8\) and \(r=2\), we obtain an asymptotic formula without oscillating terms. Indeed, according to Theorem 3.5 (4) and Remark 3.8, respectively, we obtain for residue classes \(a_1 \not = a_2\) that

$$\begin{aligned} (p(a_1, 8, n) - p(a_2, 8, n))^2 + (p(a_1+2,8,n) - p(a_2+2,8,n))^2 \sim B_{a_1,a_2,8}^2 n^{-\frac{3}{2}} \exp \left( 4\lambda _1 \sqrt{n}\right) . \end{aligned}$$

There is no difficulty to extend this type of asymptotic formula for higher differences in the spirit of Theorem 3.7 (1).

4 Proof of Theorem 3.2

Since the asymptotic formulas for \(Q_n(1)\) and \(Q_n(-1)\) are well-known, we assume throughout that \(1 \le a < \frac{b}{2}\) with \(\gcd (a,b)=1\) and \(b \ge 3,\) since \(\overline{Q_n(\zeta )} = Q_n(\overline{\zeta })\).

The setup follows the standard Hardy–Ramanujan circle method, expressing \(Q_n(\zeta )\) as a contour integral about 0 and breaking the contour apart with the sequence of Farey fractions of order N. For facts about the Farey sequence, we refer the reader to Chapter 3 of [14]. Much of the analysis in this section closely follows [18] after assuming the technical Lemmas 4.2 and 4.3 which we prove in the next section.

Let \(N=\lfloor \delta \sqrt{n} \rfloor \), for some \(\delta >0\) to be chosen independently of n and small enough during the course of the proof. Let \(\mathcal {F}_N\) be the sequence of Farey fractions of order N with mediants \(\theta _{h,k}'\) and \(\theta _{h,k}''\) at \(\frac{h}{k}\). We write

$$\begin{aligned} t_{\theta }:=t_n- 2 \pi i \theta , \qquad \text {where} \qquad t_n\sqrt{n}:=\frac{\sqrt{\mathrm {Li}_2\left( \zeta _b^{ak_0}\right) }}{k_0},\end{aligned}$$
(4.1)

with \(k_0 \in \{1,2,3\}\) according to whether we are in case (1), (2) or (3).

By Cauchy’s integral formula, we have

$$\begin{aligned} Q_n\left( \zeta _b^a\right)&=\int _{0}^{1} \left( \zeta _b^ae^{-t_n+2\pi i \theta };e^{-t_n+2\pi i \theta }\right) _{\infty }^{-1}e^{nt_n-2 \pi i n \theta } d \theta \\&=\sum _{\frac{h}{k} \in \mathcal {F}_N } \zeta _k^{-hn} \int _{-\theta _{h,k}'}^{\theta _{h,k}''} \exp \left( \frac{\mathrm {Li}_2\left( \zeta _b^{ak}\right) }{k^2t_{\theta }} +nt_{\theta } + E_{h,k}(\zeta _b^a,t_{\theta })\right) d\theta , \end{aligned}$$

where

$$\begin{aligned} E_{h,k}(z,t):=&\ \mathrm {Log}\left( \left( z \zeta _k^h e^{-t};\zeta _k^h e^{-t}\right) _{\infty }^{-1}\right) -\frac{\mathrm {Li}_2\left( z^k\right) }{k^2t}. \end{aligned}$$

We will show that the integral(s) where \(k=k_0\) dominate, that is they are the major arcs, and all the other integrals are exponentially smaller, that is they are minor arcs. The \(E_{h,k}\) will be shown to be error terms on all arcs; the following gives the growth of the \(E_{h,k}\) up to o(1) on each of the possible major arcs.

Lemma 4.1

(1) For \(2\pi \frac{a}{b} \in (0, \theta _{13})\) and \(-\theta _{0,1}' \le \theta \le \theta _{0,1}''\), we have

$$\begin{aligned} E_{0,1}(\zeta _b^a,t_{\theta })= \mathrm {Log}\left( \omega _{0,1}\left( \zeta _b^a\right) \right) +o(1). \end{aligned}$$

(2) For \(2\pi \frac{a}{b} \in (\theta _{23}, \pi )\) and \(-\theta _{1,2}' \le \theta \le \theta _{1,2}''\), we have

$$\begin{aligned} E_{1,2}(\zeta _b^a,t_{\theta })= \mathrm {Log}\left( \omega _{1,2}\left( \zeta _b^a\right) \right) +o(1). \end{aligned}$$

(3) For \(2\pi \frac{a}{b} \in (\theta _{13},\theta _{23})\setminus \left\{ \frac{2\pi }{3}\right\} \) and \(-\theta _{1,3}' \le \theta \le \theta _{1,3}''\), we have

$$\begin{aligned} E_{1,3}(\zeta _b^a,t_{\theta })= \mathrm {Log}\left( \omega _{1,3}(\zeta _b^a)\right) + o(1), \end{aligned}$$

and for \(-\theta _{2,3}' \le \theta \le \theta _{2,3}''\), we have

$$\begin{aligned} E_{2,3}(\zeta _b^a,t_{\theta })= \mathrm {Log}\left( \omega _{2,3}(\zeta _b^a)\right) + o(1). \end{aligned}$$

(4) For \(\frac{a}{b}=\frac{1}{3}\) and \(-\theta _{1,3}' \le \theta \le \theta _{1,3}''\), we have

$$\begin{aligned} E_{1,3}(\zeta _3,t_{\theta })&=\mathrm {Log}\left( t_{\theta }^{\frac{1}{6}}\right) +\mathrm {Log}\left( \left( 1-\zeta _3^2\right) ^{-\frac{1}{6}}\left( 1-\zeta _3\right) ^{\frac{1}{2}} \right) +\log \left( \Gamma \left( \frac{2}{3}\right) \right) \\&\quad +\frac{1}{6}\log \left( 3\right) -\frac{1}{2}\log (2\pi )+ o(1), \end{aligned}$$

and for \(-\theta _{2,3}' \le \theta \le \theta _{2,3}''\), we have

$$\begin{aligned} E_{2,3}(\zeta _3,t_{\theta })&=\mathrm {Log}\left( t_{\theta }^{-\frac{1}{6}}\right) +\mathrm {Log}\left( \left( 1-\zeta _3^2\right) ^{\frac{1}{6}}(1-\zeta _3)^{\frac{1}{2}} \right) +\log \left( \Gamma \left( \frac{1}{3}\right) \right) \\&\quad +\frac{1}{6}\log \left( \frac{1}{3}\right) -\frac{1}{2}\log (2\pi )+ o(1). \end{aligned}$$

The next two lemmas give uniform bounds on \(E_{h,k}\) to be applied on the minor arcs. The proofs are quite intricate and are provided in the next section. We assume throughout that \(0<\varepsilon \le \frac{1}{4}\).

Lemma 4.2

Uniformly for \(k \le n^{\varepsilon }\) and \(-\theta _{h,k}' \le \theta \le \theta _{h,k}''\), we have

$$\begin{aligned} E_{h,k}(\zeta _b^a,t_{\theta })=O\left( n^{3\varepsilon -\frac{1}{2}}\right) +O\left( n^{\varepsilon }\right) . \end{aligned}$$

The next lemma treats the case of large denominators.

Lemma 4.3

Uniformly for \(k \ge n^{\varepsilon }\) and \(-\theta _{h,k}' \le \theta \le \theta _{h,k}''\), we have

$$\begin{aligned} E_{h,k}(\zeta _b^a,t_{\theta })=O\left( N\right) . \end{aligned}$$

We postpone the proofs of Lemmas 4.14.3 until Section 5. With these key lemmas in hand, the proof of Theorem 3.2 follows [18] closely.

Proof of Theorem 3.2

Cases (1), (2) and (3). Assume \(\frac{a}{b} \ne \frac{1}{3}.\) We write

$$\begin{aligned} \lambda _1+i\lambda _2:=\frac{\sqrt{\mathrm {Li}_2(\zeta _b^{ak_0})}}{k_0}. \end{aligned}$$

It follows from the choice \(0 < \varepsilon \le \frac{1}{4}\), Lemmas 4.2 and 4.3 that \(E_{h,k}(\zeta _b^a,t_{\theta })=\delta O(\sqrt{n})\) uniformly. Using this and Lemma 4.1, we have

$$\begin{aligned}&e^{-2\lambda _1\sqrt{n}}Q_n\left( \zeta _b^a \right) \nonumber \\&\quad =\sum _{\begin{array}{c} h \\ \frac{h}{k_0} \in \mathcal {F}_N \end{array}} \zeta _{k_0}^{-hn}\omega _{h,k_0}(\zeta _b^a)\int _{-\theta _{h,k_0}'}^{\theta _{h,k_0}''} \exp \left( -2\lambda _1\sqrt{n}+\frac{(\lambda _1+i\lambda _2)^2}{t_{\theta }}+nt_{\theta } + o(1)\right) d\theta \nonumber \\&\qquad +\sum _{\begin{array}{c} \frac{h}{k} \in \mathcal {F}_N \\ k \ne k_0 \end{array}} \zeta _{k}^{-hn} \int _{-\theta _{h,k}'}^{\theta _{h,k}''} \exp \left( -2\lambda _1\sqrt{n}+\frac{\mathrm {Li}_2\left( \zeta _b^{ak}\right) }{k^2t_{\theta }} +nt_{\theta } + \delta O\left( \sqrt{n}\right) \right) d\theta . \end{aligned}$$
(4.2)

Recalling (4.1), we rewrite the first term in (4.2) as

$$\begin{aligned}&\sum _{\begin{array}{c} 1 \le h < k_0 \\ (h,k)=1 \end{array}}\zeta _{k_0}^{-hn}\omega _{h,k_0}\left( \zeta _b^a \right) \exp \left( i2\lambda _2\sqrt{n}\right) \int _{-\theta _{h,k_0}'}^{\theta _{h,k_0}''} \exp \left( \sqrt{n}\left( \frac{\lambda _1+i\lambda _2}{1-\frac{2\pi i \theta \sqrt{n}}{\lambda _1+i\lambda _2}}-(\lambda _1+i\lambda _2) \right) - 2 \pi in\theta \right) d \theta . \end{aligned}$$

We can estimate the mediants as \(\frac{1}{\sqrt{n}}\ll \theta _{h,k_0}', \theta _{h,k_0}'' \ll \frac{1}{\sqrt{n}}\) and setting \(\theta \mapsto \theta n^{-\frac{1}{2}}\), the above integral is asymptotic to

$$\begin{aligned} \frac{1}{n^{\frac{1}{2}}}\int _{-c}^{c} \exp \left( \sqrt{n}\left( \frac{\lambda _1+i\lambda _2}{1-\frac{2\pi i \theta }{\lambda _1+i\lambda _2}}-(\lambda _1+i\lambda _2) -2 \pi i \theta \right) \right) d \theta =:\frac{1}{n^{\frac{1}{2}}}\int _{-c}^ce^{\sqrt{n}B(\theta )}d\theta , \end{aligned}$$
(4.3)

for some \(c>0\), say. We claim that we can apply Theorem 2.1 with \(x_0 \mapsto 0,\) \(A(x) \mapsto 1\) and B as above. Here, \(B(0)=0\) and expanding the geometric series gives

$$\begin{aligned} B(\theta )=-\frac{4 \pi ^2}{\lambda _1+i\lambda _2}\theta ^2+o\left( \theta ^2\right) , \qquad \theta \rightarrow 0, \end{aligned}$$

with \(\mathrm {Re}\left( \frac{4 \pi ^2}{\lambda _1+i\lambda _2} \right) > 0\). Finally, we claim that \(\mathrm {Re}(B(\theta )) \le 0\) with equality if and only if \(\theta =0.\) Indeed,

$$\begin{aligned} \mathrm {Re}(B(\theta ))=\mathrm {Re}\left( \frac{\lambda _1+i\lambda _2}{1-\frac{2\pi i \theta }{\lambda _1+i\lambda _2}}\right) -\lambda _1 =\frac{|\lambda _1+i\lambda _2|^2}{\lambda _1}\mathrm {Re}\left( \frac{e^{i\psi }}{1+i\left( \frac{\lambda _2}{\lambda _1}-\frac{2\pi \theta }{\lambda _1}\right) } \right) -\lambda _1, \end{aligned}$$

where \(\lambda _1+i\lambda _2=\left| \lambda _1+i\lambda _2 \right| e^{i\frac{\psi }{2}}\) and \(\psi \in \left( -\frac{\pi }{2}, \frac{\pi }{2}\right) .\) Lemma 2.7 applies to show

$$\begin{aligned} \mathrm {Re}(B(\theta )) \le \frac{|\lambda _1+i\lambda _2|^2}{\lambda _1}\cos ^2\left( \frac{\psi }{2}\right) -\lambda _1=\frac{\lambda _1^2}{\lambda _1}-\lambda _1=0, \end{aligned}$$

with equality if and only if

$$\begin{aligned} \mathrm {Arg}\left( 1+i\left( \frac{\lambda _2}{\lambda _1}-\frac{2\pi \theta }{\lambda _1}\right) \right) =\frac{\psi }{2}=\mathrm {Arg}\left( \lambda _1+i\lambda _2\right) , \end{aligned}$$

thus if and only if \(\theta =0,\) as claimed. Now by Theorem 2.1, we conclude that (4.3) is asymptotic to

$$\begin{aligned} \frac{\sqrt{\lambda _1+i\lambda _2}}{2\sqrt{\pi }n^{\frac{3}{4}}}, \end{aligned}$$

and overall

$$\begin{aligned}&\sum _{\begin{array}{c} 1 \le h< k_0 \\ (h,k)=1 \end{array}}\zeta _{k_0}^{-hn}\omega _{h,k_0}\left( \zeta _b^a\right) \times \int _{-\theta _{h,k_0}'}^{\theta _{h,k_0}''} \exp \left( -2\lambda _1\sqrt{n} +\frac{(\lambda _1+i\lambda _2)^2}{\frac{\lambda _1+i\lambda _2}{\sqrt{n}}-2 \pi i \theta } +\sqrt{n}(\lambda _1+i\lambda _2)-2 \pi i n\theta \right) d \theta \\&\quad \sim \frac{\sqrt{\lambda _1+i\lambda _2}}{2\sqrt{\pi }n^{\frac{3}{4}}}e^{2i\lambda _2\sqrt{n}}\sum _{\begin{array}{c} 1 \le h < k_0 \\ (h,k_0)=1 \end{array}} \zeta _{k_0}^{-hn}\omega _{h,k_0}\left( \zeta _b^a\right) . \end{aligned}$$

When the \(e^{2\lambda _1\sqrt{n}}\) is brought back to the right-hand side, this is the right-hand side of Theorem 3.2.

For \(k\ne k_0\), we follow Parry in Lemma 5.2 of [18] and write

$$\begin{aligned} \mathrm {Re}\left( \frac{\mathrm {Li}_2\left( \zeta _b^{ak}\right) }{k^2t_{\theta }} + nt_{\theta }\right)&=\lambda _1\sqrt{n}\left( \frac{\left| \mathrm {Li}_2\left( \zeta _b^{ak}\right) \right| }{k^2\lambda _1^2} \mathrm {Re}\left( \frac{e^{i\psi _k}}{1+i\left( \frac{\lambda _2}{\lambda _1}-\frac{2\pi \theta \sqrt{n}}{\lambda _1}\right) }\right) +1\right) , \end{aligned}$$

where \(\psi _k\) satisfies \(\mathrm {Li}_2(\zeta _b^{ak})=|\mathrm {Li}_2(\zeta _b^{ak})|e^{i\psi _k}.\) Arguing as for the major arcs, the expression \(\mathrm {Re}(\cdot )\) above is at most \(\cos ^2\left( \frac{\psi _k}{2}\right) \). Now let

$$\begin{aligned} \Delta := \inf _{k \ne k_0}\left( 1-\left( \mathrm {Re}\left( \frac{\sqrt{\mathrm {Li}_2(\zeta _b^{ak})}}{k\lambda _1}\right) \right) ^2\right) >0. \end{aligned}$$

Then

$$\begin{aligned} \mathrm {Re}\left( \frac{\mathrm {Li}_2(\zeta _b^{ak})}{k^2t_{\theta }} + nt_{\theta }\right) \le \lambda _1\sqrt{n}\left( \frac{\left| \mathrm {Li}_2\left( \zeta _b^{ak}\right) \right| }{k^2\lambda _1^2}\cos ^2\left( \frac{\psi _k}{2}\right) +1\right) \le \lambda _1 \sqrt{n}(2-\Delta ). \end{aligned}$$

Thus,

$$\begin{aligned}&\left| \sum _{\begin{array}{c} \frac{h}{k} \in \mathcal {F}_N \\ k \ne k_0 \end{array}} \zeta _{k}^{-hn} \int _{-\theta _{h,k}'}^{\theta _{h,k}''}\exp \left( -2\lambda _1\sqrt{n}+\frac{\mathrm {Li}_2(z^k)}{k^2t_{\theta }} +nt_{\theta } + \delta O(\sqrt{n})\right) d\theta \right| \le \exp \left( -\lambda _1\Delta \sqrt{n}+ \delta O\left( \sqrt{n}\right) \right) . \end{aligned}$$

We can choose \(\delta \) small enough so that the constant in the exponential is negative, and the minor arcs are exponentially smaller than the major arc(s). This completes the proof of cases (1), (2) and (3).

For case (4), we have \(\lambda _1+i\lambda _2=\lambda _1=\frac{\sqrt{\mathrm {Li}_2(1)}}{3}=\frac{\pi }{3\sqrt{6}}\). Exactly as in case (3) the minor arcs are those with \(k \ne 3\), and these are shown to be exponentially smaller than for \(k_0=3\). Thus, by Lemma 4.1 part (4), we have

$$\begin{aligned} e^{-2\lambda _1\sqrt{n}}Q_n(\zeta _3)&= \zeta _3^{-n}C_{1,3} \int _{-\theta _{1,3}'}^{\theta _{1,3}''} t_{\theta }^{\frac{1}{6}} \exp \left( -2\lambda _1\sqrt{n}+\frac{\lambda _1^2}{t_{\theta }}+nt_{\theta }+o(1) \right) d \theta \nonumber \\&\quad + \zeta ^{-2n}_3C_{2,3} \int _{-\theta _{2,3}'}^{\theta _{2,3}''} t_{\theta }^{-\frac{1}{6}} \exp \left( -2\lambda _1\sqrt{n}+\frac{\lambda _1^2}{t_{\theta }}+nt_{\theta }+o(1) \right) d \theta , \end{aligned}$$

where

$$\begin{aligned} C_{1,3}&:=\left( 1-\zeta _3^2\right) ^{-\frac{1}{6}}(1-\zeta _3)^{\frac{1}{2}}\Gamma \left( \frac{2}{3}\right) \frac{3^{\frac{1}{6}}}{\sqrt{2\pi }}, \quad C_{2,3}&:=\left( 1-\zeta _3^2\right) ^{\frac{1}{6}}(1-\zeta _3)^{\frac{1}{2}}\Gamma \left( \frac{1}{3}\right) \frac{1}{3^{\frac{1}{6}}\sqrt{2\pi }}. \end{aligned}$$

Noting

$$\begin{aligned} t_{\theta }=\frac{\pi }{3\sqrt{6n}}\left( 1-6i\sqrt{6n}\theta \right) , \end{aligned}$$

we have

$$\begin{aligned}&e^{-2\lambda _1\sqrt{n}}Q_n(\zeta _3)\nonumber \\&\quad =\zeta _3^{-n}C_{1,3}\frac{(\pi )^{\frac{1}{6}}}{3^{\frac{1}{6}}(6n)^{\frac{1}{12}}} \int _{-\theta _{1,3}'}^{\theta _{1,3}''} \left( 1-6i\sqrt{6n}\theta \right) ^{\frac{1}{6}} \exp \left( -2\lambda _1\sqrt{n}+\frac{\lambda _1^2}{t_{\theta }}+nt_{\theta }+o(1) \right) d \theta \nonumber \\&\qquad + \zeta ^{-2n}_3C_{2,3}\frac{3^{\frac{1}{6}}(6n)^{\frac{1}{12}}}{(\pi )^{\frac{1}{6}}} \int _{-\theta _{2,3}'}^{\theta _{2,3}''} \left( 1-6i\sqrt{6n}\theta \right) ^{-\frac{1}{6}} \exp \left( -2\lambda _1\sqrt{n}+\frac{\lambda _1^2}{t_{\theta }}+nt_{\theta }+o(1) \right) d \theta . \end{aligned}$$
(4.4)

Setting \(\theta \mapsto \theta n^{-\frac{1}{2}}\) and arguing as before, both integrals are asymptotic to

$$\begin{aligned} \frac{\sqrt{\lambda _1}}{2\sqrt{\pi }n^{\frac{3}{4}}}=\frac{1}{2^{\frac{5}{4}}3^{\frac{3}{4}}n^{\frac{3}{4}}}. \end{aligned}$$

Hence, the second term in (4.4) dominates and gives the claimed asymptotic formula. \(\square \)

5 Proof of Lemmas 4.14.2 and 4.3

We prove Lemma 4.2 first then make use of these ideas in the proof of Lemma 4.1. We finish the section by proving Lemma 4.3.

5.1 Proof of Lemma 4.2

We rewrite \(E_{h,k}\) as a sum of two functions: a function to which we can apply Euler–Maclaurin summation, and another to which we apply the tools in Proposition 2.5 and Lemma 2.9.

Lemma 5.1

For \(\mathrm {Re}(t)>0\) and \(z=\zeta _b^a,\) we have

$$\begin{aligned} E_{h,k}(z,t)&=\sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} \zeta _b^{ma} \zeta _k^{jmh}kt\sum _{\ell \ge 0} g_{j,k}\left( t(bk^2 \ell + km) \right) + \mathrm {Log}\left( \prod _{j=1}^k \left( 1-\zeta _b^{a} \zeta _k^{-jh}e^{-jt}\right) ^{-\frac{1}{2}+\frac{j}{k}}\right) , \end{aligned}$$
(5.1)

where

$$\begin{aligned} g_{j,k}(w):=\frac{e^{-\frac{j}{k}w}}{w(1-e^{-w})}-\frac{1}{w^2}-\left( \frac{1}{2}-\frac{j}{k} \right) \frac{e^{-\frac{j}{k}w}}{w}. \end{aligned}$$

Proof

In \(E_{h,k}\), we expand the logarithm using its Taylor series as

$$\begin{aligned} \mathrm {Log}\left( \zeta _b^{a} \zeta _k^{h}e^{-t}; \zeta _k^{h}e^{-t}\right) _{\infty }^{-1}&=\sum _{\begin{array}{c} \nu \ge 1 \\ \ell \ge 1 \end{array}} \frac{ \zeta _b^{\ell a} \zeta _k^{\ell \nu h}e^{-\ell \nu t}}{\ell } =\sum _{\begin{array}{c} 1 \le j \le k \\ 1 \le m \le bk \end{array}}\sum _{\begin{array}{c} \nu \ge 0 \\ \ell \ge 0 \end{array}} \frac{\zeta _{bk}^{m(ka+bjh)}e^{-(bk\ell +m) (\nu k + j)t}}{bk\ell +m} \\&=\sum _{\begin{array}{c} 1 \le j \le k \\ 1 \le m \le bk \end{array}}\zeta _{b}^{ma}\zeta _{k}^{mjh}\sum _{\ell \ge 0} \frac{e^{-jt(bk\ell +m)}}{(bk\ell +m)(1-e^{-t(bk^2\ell +km)})}. \end{aligned}$$

This corresponds to the left term in \(g_{j,k}.\) For the middle term in \(g_{j,k}\), we compute (using \(\gcd (h,k)=1\))

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le j \le k \\ 1 \le m \le bk \end{array}}\zeta _{b}^{ma}\zeta _{k}^{mjh}kt\sum _{\ell \ge 0} \frac{1}{t^2(bk^2\ell +km)^2} =\frac{k^2}{t}\sum _{\begin{array}{c} 1 \le m \le bk \\ m \equiv 0 \pmod {k} \end{array}}\sum _{\ell \ge 0} \zeta _{b}^{ma}\frac{1}{(bk^2\ell +mk)^2} =\frac{1}{tk^2} \mathrm {Li}_2\left( \zeta _{b}^{ka} \right) . \end{aligned}$$

Finally, it is simple to show that the logarithm of the product in (5.1) cancels with the sum of the right term in \(g_{j,k}\), simply by expanding the logarithm into its Taylor series. \(\square \)

We estimate the first term in (5.1) using Euler–Maclaurin summation. First, we need a technical definition. Since \(\text {gcd}(h,k) =1\), there is at most one \(j_0\) in the sum in (5.1) for which \(\zeta _{b}^{a}\zeta _{k}^{j_0h}=1;\) i.e., such that \(ak+bj_0h\equiv 0 \pmod {bk}.\) Define

$$\begin{aligned} \mathcal {S}_{a,b}:= \{(h,k) \in \mathbb {N}^2 : \text {there exists}\, j_0 \in [1,k]\,\text { with}\, ak + j_0b h \equiv 0 \pmod {bk}\}. \end{aligned}$$

Lemma 5.2

Let \(j_0\) be as above. For \(k \le n^{\varepsilon }\) and \(-\theta _{h,k}' \le \theta \le \theta _{h,k}''\), we have

$$\begin{aligned}&\sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} \zeta _b^{ma} \zeta _k^{jmh}kt_{\theta }\sum _{\ell \ge 0} g_{j,k}\left( t_{\theta }(bk^2 \ell + km) \right) \\ {}&=\left( \log \left( \Gamma \left( \frac{j_0}{k}\right) \right) +\left( \frac{1}{2}-\frac{j_0}{k}\right) \log \left( \frac{j_0}{k}\right) -\frac{1}{2}\log (2 \pi )\right) 1_{(h,k) \in \mathcal {S}_{a,b}} +O\left( \frac{k^3}{\sqrt{n}}\right) +O\left( \frac{k^5}{n}\right) . \end{aligned}$$

Proof

Note that the function \(g_{j,k}(w)\) is holomorphic at 0 and in any cone \(|\mathrm {Arg}(w)| \le \frac{\pi }{2} - \eta .\) Also, \(\theta _{h,k}', \theta _{h,k}'' \le \frac{1}{kN}=O\left( \frac{1}{\sqrt{n}}\right) \) implies that \(t_{\theta }\) lies in such a fixed cone (see also [1] on p. 75). Thus, we can apply Theorem 2.3 to \(g_{j,d}(z)\) with \(w\mapsto t_{\theta }bk^2\), \(a\mapsto \frac{m}{bk},\) and \(N \mapsto 0\),

$$\begin{aligned} \sum _{\ell \ge 0} g_{j,k}\left( t_{\theta }bk^2\left( \ell +\frac{m}{bk}\right) \right)&=\frac{1}{t_{\theta }bk^2}\int _0^{\infty } g_{j,k}(w)dw-\left( \frac{1}{12}-\frac{j^2}{2k^2}\right) \left( \frac{1}{2}-\frac{m}{bk}\right) +O\left( \frac{k^2}{\sqrt{n}}\right) . \end{aligned}$$

When summing the O-term, we get

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} kt_{\theta } O\left( \frac{k^2}{\sqrt{n}}\right) =O\left( \frac{k^5}{n} \right) , \end{aligned}$$

where we used the fact that \(t_{\theta }\) lies in a cone. Summing first over m gives

$$\begin{aligned} \sum _{1 \le m \le bk} \zeta _{b}^{ma} \zeta _k^{jmh}\left( \frac{1}{12}-\frac{j^2}{2k^2}\right) \left( \frac{1}{2}-\frac{m}{bk}\right) = O\left( k\right) . \end{aligned}$$

Hence,

$$\begin{aligned}&\sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} \zeta _b^{ma} \zeta _k^{jmh}kt_{\theta }\sum _{\ell \ge 0} g_{j,k}\left( t_{\theta }(bk^2 \ell + km) \right) \\&\quad =\left( \int _0^{\infty } g_{j_0,k}(w)dw\right) 1_{(h,k) \in \mathcal {S}_{a,b}}+O\left( \frac{k^3}{\sqrt{n}}\right) +O\left( \frac{k^2}{\sqrt{n}}\right) +O\left( \frac{k^5}{n}\right) \\&\quad =\left( \log \Gamma \left( \frac{j_0}{k}\right) +\left( \frac{1}{2}-\frac{j_0}{k}\right) \log \left( \frac{j_0}{k}\right) -\frac{1}{2}\log (2 \pi )\right) 1_{(h,k) \in \mathcal {S}_{a,b}} +O\left( \frac{k^3}{\sqrt{n}}\right) +O\left( \frac{k^5}{n}\right) , \end{aligned}$$

where the last step follows by Lemma 2.4. If \(\varepsilon <\frac{1}{4},\) then the terms \(O\left( \frac{k^3}{\sqrt{n}}\right) \) and \(O\left( \frac{k^5}{n}\right) \) are smaller than \(\sqrt{n}\) as needed since \(N = O(\delta \sqrt{n})\) where \(\delta \) is chosen small and independently of n. \(\square \)

It remains to estimate the product term in (5.2).

Lemma 5.3

Uniformly for \(k \le n^{\varepsilon }\) and \(-\theta _{h,k} \le \theta \le \theta _{h,k}''\), we have

$$\begin{aligned} \mathrm {Log}\left( \prod _{j=1}^k \left( 1-\zeta _b^{a} \zeta _k^{-jh}e^{-jt_{\theta }}\right) ^{-\frac{1}{2}+\frac{j}{k}}\right) = O\left( n^{\varepsilon }\right) . \end{aligned}$$

Proof

Recall the sums \(G_m\) defined in Lemma 2.9. Using the Taylor expansion for the logarithm followed by Proposition  2.5, we write

$$\begin{aligned} \left| \mathrm {Log}\left( \prod _{j=1}^k \left( 1-\zeta _b^{a} \zeta _k^{-jh}e^{-jt_{\theta }}\right) ^{-\frac{1}{2}+\frac{j}{k}}\right) \right|&= \left| \sum _{j=1}^k\left( \frac{1}{2}-\frac{j}{k}\right) \sum _{m \ge 1} \frac{ \zeta _{bk}^{m(ak+bjh)}}{m}e^{-jmt_{\theta }} \right| \\ {}&=\left| \sum _{j=1}^k\left( \frac{1}{2}-\frac{j}{k}\right) (1-e^{-jt_{\theta }})\sum _{m \ge 1} G_m\left( \frac{ak+bhj}{bk}\right) e^{-mjt_{\theta }}\right| . \end{aligned}$$

It is elementary to show that at most one of \(\{ak+bjh\}_{1 \le j \le k}\) is divisible by bk. Suppose that this happens at \(j_0\) (if it never happens, then the argument is similar). Then \(G_m\left( \frac{ak+bhj_0}{bk}\right) =H_m\), the m-th harmonic number. Applying the formula \(\sum _{m \ge 1} H_mx^m=\frac{-\log (1-x)}{1-x}\), the above is

$$\begin{aligned}&\ll \left| 1-e^{-j_0t_{\theta }}\right| \sum _{m \ge 1} H_m e^{-mj_0\mathrm {Re}(t_{\theta })}+ \sum _{\begin{array}{c} 1 \le j \le k \\ j \ne j_0 \end{array}} \left| 1-e^{-jt_{\theta }}\right| \max _{m \ge 1} \left| G_m\left( \frac{a}{b}+\frac{hj}{k}\right) \right| \sum _{m \ge 1} e^{-mj\mathrm {Re}(t_{\theta })} \\&\ll \left| \log \left( 1-e^{-j_0t_{\theta }}\right) \right| \frac{|1-e^{-j_0t_{\theta }}|}{1-e^{-j_0\mathrm {Re}(t_{\theta })}}+ \sum _{\begin{array}{c} 1 \le j \le k \\ j \ne j_0 \end{array}} \frac{\left| 1-e^{-jt_{\theta }}\right| }{1-e^{-j\mathrm {Re}(t_{\theta })}}\max _{m \ge 1} \left| G_m\left( \frac{a}{b}+\frac{hj}{k}\right) \right| . \end{aligned}$$

The fact that \(t_{\theta }\) lies in a cone \(|\mathrm {Arg}(t_{\theta })|\le \frac{\pi }{2}-\eta \) with \(j \le k \le n^{\varepsilon }<\sqrt{n}\) gives

$$\begin{aligned} \frac{\left| 1-e^{-jt_{\theta }}\right| }{1-e^{-j\mathrm {Re}(t_{\theta })}}= O \left( \frac{|t_{\theta }|}{\mathrm {Re}(t_{\theta })}\right) =O(1). \end{aligned}$$

Thus, using Lemma 2.10

$$\begin{aligned} \left| \mathrm {Log}\left( \prod _{j=1}^k \left( 1-\zeta _b^{a} \zeta _k^{-jh}e^{-jt_{\theta }}\right) ^{-\frac{1}{2}+\frac{j}{k}}\right) \right|&=O(\log ( n))+O\left( \sum _{\begin{array}{c} 1 \le j \le k \\ j \ne j_0 \end{array}} \max _{m \ge 1} \left| G_m\left( \frac{a}{b}+\frac{hj}{k}\right) \right| \right) \\&=O(\log (n))+O(k)=O(n^{\varepsilon }), \end{aligned}$$

as claimed. \(\square \)

Lemma 4.2 now follows from Lemmas 5.15.2 and  5.3 by recalling that \(k\le n^{\varepsilon }\) where \(0 < \varepsilon \le \frac{1}{4}\):

$$\begin{aligned} E_{h,k}(\zeta ^a_b,t_\theta )&= \left( \log \left( \Gamma \left( \frac{j_0}{k}\right) \right) +\left( \frac{1}{2}-\frac{j_0}{k}\right) \log \left( \frac{j_0}{k}\right) -\frac{1}{2}\log (2 \pi )\right) 1_{(h,k) \in \mathcal {S}_{a,b}}\\&\quad +O\left( \frac{k^3}{\sqrt{n}}\right) +O\left( \frac{k^5}{n}\right) + O\left( n^\varepsilon \right) \\&\ll \log (n) + n^{3\varepsilon -\frac{1}{2}}+n^\varepsilon = O\left( n^{3\varepsilon -\frac{1}{2}}\right) + O\left( n^\varepsilon \right) . \end{aligned}$$

5.2 Proof of Lemma  4.1

To prove Lemma 4.1, we need an elementary fact about the sets \(\mathcal {S}_{a,b}\).

Lemma 5.4

Let \(1 \le a < \frac{b}{2}\) with \(\gcd (a,b)=1\) and \(b \ge 3\). Then \((1,1)\not \in \mathcal {S}_{a,b}\), \((h,2)\not \in \mathcal {S}_{a,b}\), and \((h,3)\in \mathcal {S}_{a,b}\) if and only if \((a,b) =(1,3)\).

Proof

We prove the case \((h,k) = (h,2)\) and note that the remaining cases are analogous. We have that \( (h,2) \in S_{a,b}\) if and only if 2b divides \(2a+b\) or \(2a+2b\). Clearly, \(2b \not \mid (2a+2b)\), and since \(2a+b< 3b < 2 \cdot (2b)\),

$$\begin{aligned} 2b \mid (2a+b) \iff 2a+b=2b \iff 2a=b \iff (a,b)=(1,2), \end{aligned}$$

which is a contradiction. \(\square \)

Proof of Lemma 4.1

Cases (1), (2) and (3) are simple consequences of Lemmas 5.1 and 5.2 and 5.4. For case (4), we suppose \(\zeta = \zeta _3\). Then one finds \(j_0(1,3,1,3)=2\) and Lemmas 5.1 and  5.2 imply

$$\begin{aligned} E_{1,3}( \zeta _3,t_{\theta })&=\mathrm {Log}\left( \prod _{j=1}^3\left( 1- \zeta _3 \zeta _3^{j}e^{-jt_{\theta }}\right) ^{-\frac{1}{2}+\frac{j}{3}}\right) +\log \left( \Gamma \left( \frac{2}{3}\right) \right) -\frac{1}{6}\log \left( \frac{2}{3}\right) -\frac{1}{2}\log (2\pi )+o(1)\\&=\mathrm {Log}\left( t_{\theta }^{\frac{1}{6}}\right) +\mathrm {Log}\left( \frac{(1- \zeta _3)^{\frac{1}{2}}}{(1- \zeta _3^2)^{\frac{1}{6}}} \right) +\log \left( \Gamma \left( \frac{1}{3}\right) \right) +\frac{1}{6}\log \left( 3\right) -\frac{1}{2}\log (2\pi )+o(1) , \end{aligned}$$

as claimed, whereas \(j_0(1,3,2,3)=1\), and so

$$\begin{aligned}&E_{2,3}(\zeta _b^{a},t_{\theta }) =\log \prod _{j=1}^3\left( 1- \zeta _3 \zeta _3^{2j}e^{-jt_{\theta }}\right) ^{-\frac{1}{2}+\frac{j}{3}}+\log \Gamma \left( \frac{1}{3}\right) + \frac{1}{6}\log \left( \frac{1}{3}\right) - \frac{1}{2}\log (2 \pi )+o(1) \\&\quad =\log \left( t_{\theta }^{-\frac{1}{6}}\right) +\log \left( \left( 1- \zeta _3^2\right) ^{\frac{1}{6}}(1- \zeta _3)^{\frac{1}{2}} \right) +\log \Gamma \left( \frac{1}{3}\right) +\frac{1}{6}\log \left( \frac{1}{3}\right) -\frac{1}{2}\log (2\pi )+ o(1), \end{aligned}$$

as claimed. \(\square \)

5.3 Proof of Lemma 4.3

In preparation for the proof of Lemma 4.3, we rewrite \(E_{h,k}\) as in Lemma 5.1, this time using only the first two terms of \(g_{j,k}\). The proof is analogous.

Lemma 5.5

For \(\mathrm {Re}(t)>0\) and \(z=\zeta _b^{a},\) we have

$$\begin{aligned} E_{h,k}(z,t)=\sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} \zeta _b^{ma} \zeta _k^{jmh}kt\sum _{\ell \ge 0} \widetilde{g}_{j,k}\left( t\left( bk^2 \ell + km\right) \right) ,\end{aligned}$$
(5.2)

where

$$\begin{aligned} \widetilde{g}_{j,k}(w):=\frac{e^{-\frac{j}{k}w}}{w(1-e^{-w})}-\frac{1}{w^2}. \end{aligned}$$

We will need to estimate the sum in (5.2) separately for \(\ell \ge 1\) and \(\ell =0.\) For \(\ell \ge 1\), we can first compute the sum on j as

$$\begin{aligned} \sum _{1\le j \le k} \zeta _k^{jmh}\widetilde{g}_{j,k}(z)=\frac{ \zeta _{k}^{mh}e^{-\frac{z}{k}}}{z(1- \zeta _{k}^{mh}e^{-\frac{z}{k}})}-\frac{k}{z^2} \cdot 1_{k \mid m}. \end{aligned}$$

Thus, writing \(m=\nu k\) with \(1 \le \nu \le b\) when \(k \mid m\), we have

$$\begin{aligned}&\sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} \zeta _b^{ma} \zeta _k^{jmh}kt\sum _{\ell \ge 1} \widetilde{g}_{j,k}\left( t(bk^2 \ell + km) \right) \\&\quad =t\sum _{\nu =1}^b \zeta _{b}^{\nu ka}\sum _{\ell \ge 1} f_1\left( bkt\left( \ell + \frac{\nu }{b}\right) \right) +t\sum _{\begin{array}{c} 1 \le m \le bk \\ k \not \mid m \end{array}} \zeta _{b}^{ma}\sum _{\ell \ge 1} f_2\left( bkt\left( \ell + \frac{m}{bk}\right) \right) =:S_1+S_2, \end{aligned}$$

say, where

$$\begin{aligned} f_1(z):=\frac{e^{-z}}{z(1-e^{-z})}-\frac{1}{z^2} \end{aligned}$$

and

$$\begin{aligned} f_2(z):=\frac{ \zeta _{k}^{mh}e^{-z}}{z(1- \zeta _{k}^{mh}e^{-z})}. \end{aligned}$$

Lemma 5.6

For \(k \ge n^{\varepsilon }\), \(-\theta _{h,k}' \le \theta \le \theta _{h,k}''\) and \(t \mapsto t_{\theta }\), we have \(|S_1|=O\left( \log (n)\right) \).

Proof

We use Theorem 2.2 (with \(N \rightarrow \infty \)) to write

$$\begin{aligned} \sum _{\ell \ge 1} f_1\left( bkt_{\theta }\left( \ell + \frac{\nu }{b}\right) \right)&=\frac{f_1\left( bkt_{\theta }\left( 1+\frac{\nu }{b}\right) \right) }{2}+\int _1^{\infty }f_1\left( bkt_{\theta }\left( x+\frac{\nu }{b}\right) \right) dx\\&\quad +bkt_{\theta }\int _1^{\infty }f_1'\left( bkt_{\theta }\left( x+\frac{\nu }{b}\right) \right) \left( \{x\}-\frac{1}{2}\right) dx\\&=\frac{f_1\left( kt_{\theta }\left( b+\nu \right) \right) }{2}+\frac{1}{bkt_{\theta }}\int _{kt_{\theta }(b+\nu )}^{\infty }f_1\left( z\right) dz\\&\quad +\int _{kt_{\theta }(b+\nu )}^{\infty }f_1'\left( z\right) \left( \left\{ \frac{z-\frac{\nu }{b}}{bkt_{\theta }}\right\} -\frac{1}{2}\right) dz. \end{aligned}$$

Here, \(f_1(z) \ll \frac{1}{z}\) as \(z \rightarrow 0,\) thus

$$\begin{aligned} f_1\left( kt_{\theta }(b+\nu )\right) =O\left( \frac{1}{k|t_{\theta }|} \right) . \end{aligned}$$

Furthermore \(\int _{t\cdot \frac{c}{|t|}}^{t\infty } f_1(z)dz=O(1)\) for \(|\mathrm {Arg}(t)|\le \frac{\pi }{2}-\eta ,\) uniformly for any \(\eta , c>0.\) As noted before, \(t_{\theta }\) lies in such a cone, so

$$\begin{aligned} \frac{1}{bkt_{\theta }}\int _{kt_{\theta }(b+\nu )}^{\infty }f_1\left( z\right) dz =O\left( \frac{1}{k|t_{\theta }|}\int _{kt_{\theta }(b+\nu )}^{t_\theta \frac{2b}{|t_\theta |}}\frac{1}{z}dz\right) =O\left( \frac{|\log (kt_{\theta })|}{k|t_{\theta }|}\right) . \end{aligned}$$

Similarly, one has

$$\begin{aligned} f_1'(z)=-\frac{e^{-z}}{z(1-e^{-z})}-\frac{e^{-z}}{z^2(1-e^{-z})}-\frac{e^{-2z}}{z(1-e^{-z})^2}+\frac{2}{z^3}, \end{aligned}$$

so \(\int _{t\cdot \frac{c}{|t|}}^{t\infty } f'_1(z)dz=O(1)\) for \(|\mathrm {Arg}(t)|\le \frac{\pi }{2}-\eta ,\) for any \(\eta , c>0.\) And one has \(f_1'(z) \ll \frac{1}{z^2}\) as \(z \rightarrow 0,\) thus

$$\begin{aligned} \int _{kt_{\theta }(b+\nu )}^{\infty }f_1'\left( z\right) \left( \left\{ \frac{z-\frac{\nu }{b}}{bkt_{\theta }}\right\} -\frac{1}{2}\right) dz&=O\left( \int _{kt_{\theta }(b+\nu )}^{t_{\theta }\frac{2b}{|t_{\theta }|}} \frac{1}{z^2} dz \right) =O\left( \frac{1}{k|t_{\theta }|}\right) . \end{aligned}$$

The above bounds are all clearly uniform in \(1 \le \nu \le b\), thus overall

$$\begin{aligned} |S_1| = \sum _{\begin{array}{c} 1 \le m \le bk \\ k \not \mid m \end{array}}|t_{\theta }|O\left( \frac{|\log kt_{\theta }|}{k|t_{\theta }|}\right) =O\left( |\log (kt_{\theta })|\right) =O(\log n), \end{aligned}$$

as claimed. \(\square \)

Lemma 5.7

For \(k \ge n^{\varepsilon }\), \(-\theta _{h,k}' \le \theta \le \theta _{h,k}''\) and \(t \mapsto t_{\theta }\), we have \(|S_2|=O\left( n^{\frac{1}{2}-\varepsilon }\right) \).

Proof

For \(\mathrm {Re}(z)>0\), we see immediately that

$$\begin{aligned} |f_2(z)|\le \frac{e^{-\mathrm {Re}(z)}}{\mathrm {Re}(z)(1-e^{-\mathrm {Re}(z)})}=:\tilde{f_2}(\mathrm {Re}(z)). \end{aligned}$$

Thus, since \(\tilde{f_2}\) is decreasing, we have

$$\begin{aligned} |S_2| \le |t_{\theta }|bk \sum _{\ell \ge 1} \tilde{f_2}\left( bk\mathrm {Re}(t_{\theta })\ell \right) \le \frac{|t_{\theta }|}{\mathrm {Re}(t_{\theta })}\left( \int _{bk\mathrm {Re}(t_{\theta })}^{\infty } \tilde{f_2}(x)dx + bk\mathrm {Re}(t_{\theta }) \tilde{f_2}(bk\mathrm {Re}(t_{\theta })) \right) , \end{aligned}$$

by integral comparison. We can bound the right term as

$$\begin{aligned} bk\mathrm {Re}(t_{\theta }) \tilde{f_2}(bk\mathrm {Re}(t_{\theta }))=\frac{1}{e^{bk\mathrm {Re}(t_{\theta })}-1}\le \frac{1}{bk\mathrm {Re}(t_{\theta })}. \end{aligned}$$

Furthermore, as \(\eta \rightarrow 0^+\), we have

$$\begin{aligned} \int _{\eta }^{\infty } \tilde{f_2}(x)dx = O(1)+\int _{\eta }^1 \frac{e^{-x}}{x(1-e^{-x})}dx \le O(1)+\int _{\eta }^1 \frac{1}{x^2}dx=O\left( \frac{1}{\eta }\right) . \end{aligned}$$

Hence, overall,

$$\begin{aligned} |S_2| = O\left( \frac{1}{k\mathrm {Re}(t_{\theta })}\right) =O\left( \frac{\sqrt{n}}{k}\right) =O\left( n^{\frac{1}{2}-\varepsilon } \right) , \end{aligned}$$

as claimed. \(\square \)

It remains to estimate the double sum (5.2) for the term \(\ell =0;\) i.e.,

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} \zeta _{b}^{ma} \zeta _k^{jmh} \frac{\phi _{\frac{j}{k}}(tkm)}{m}, \end{aligned}$$

where

$$\begin{aligned} \phi _a(w):=\frac{e^{-aw}}{1-e^{-w}}- \frac{1}{w}. \end{aligned}$$

Note that \(\phi _a\) is holomorphic at 0 and in the cone \(|\mathrm {Arg}(w)| \le \frac{\pi }{2}- \eta ,\) for any \(\eta >0.\) We apply Lemma 5.8 to \(\phi _a\) to bound differences as follows.

Lemma 5.8

Let x be a complex number with positive imaginary part and \(|x| \le 1\). Then there is a constant \(c > 0\) independent from a and x, such that for all \(m \le \frac{1}{|x|}\) we have

$$\begin{aligned} \left| \phi _a(xm) - \phi _a(x(m+1))\right| \le c|x|. \end{aligned}$$

Proof

The function \(\phi _a(z)\) is holomorphic in \(B_3(0)\). The functions \(\phi _a'(z)\) are uniformly bounded on \(\overline{B_{\frac{5}{2}}(0)} \subset B_3(0)\). Indeed, we have uniformly in a

$$\begin{aligned}&\max _{|z| \le \frac{5}{2}} |\phi '_a(z)| = \max _{|z| = \frac{5}{2}} |\phi '_a(z)| \le \max _{|z| = \frac{5}{2}} \left| \frac{e^{-az-z}}{(1-e^{-z})^2}\right| + \max _{|z| = \frac{5}{2}} \left| \frac{ae^{-az}}{1-e^{-z}}\right| + \max _{|z| = \frac{5}{2}} \left| \frac{1}{z^2}\right| \ll 1. \end{aligned}$$

On the other hand, by Lemma 2.6 applied to \(f = \phi _a\), \(U = B_3(0)\), and \(\overline{B_{\frac{5}{2}}(0)} \subset U\), we find, since \(|xm| \le 1\) and \(|x(m+1)| \le |mx| + |x| \le 2\)

$$\begin{aligned} |\phi _a(xm+x) - \phi _a(mx)| \le \max _{|z| \le \frac{5}{2}} |\phi '_a(z)| |xm + x - xm| = c|x|, \end{aligned}$$

where c does not depend on \(0 < a \le 1\). \(\square \)

We also require the following lemma for large values of m, whose proof is a straightforward calculation using that the denominators of the first term in \(\phi _a(w)\) are bounded away from 0.

Lemma 5.9

Let x be a complex number with positive imaginary part. Then all \(m > \frac{1}{|x|}\) we have

$$\begin{aligned} \left| \phi _a(xm) - \phi _a(x(m+1))\right| \ll \frac{1}{|x|m(m+1)} + |x|e^{-m\mathrm {Re}(x)} + a|x| e^{-am\mathrm {Re}(x)}. \end{aligned}$$

The following lemma, when combined with Lemmas 5.55.7, completes the proof of Lemma 4.3, and thus that of Theorem 3.2.

Lemma 5.10

For \( n^{\varepsilon } \le k \le N\) and \(-\theta _{h,k}' \le \theta \le \theta _{h,k}''\), we have

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}}\zeta _b^{ma}\zeta _{k}^{jmh}\frac{\phi _{\frac{j}{k}}(t_{\theta }km)}{m}=O(k). \end{aligned}$$

Proof

Let \(x := kt_{\theta }\) and \(a := \frac{j}{k}\). Note that we have \(0 < a \le 1\), \(\mathrm {Re}(x) > 0\), and \(\frac{|x|}{\mathrm {Re}(x)} \ll 1\) uniformly in k. We use Abel partial summation and split the sum into two parts:

$$\begin{aligned} \sum _{\begin{array}{c} 1 \le m \le bk \\ 1 \le j \le k \end{array}} = \sum _{j=1}^k \left( \sum _{0< m \le \min \left\{ bk, \frac{1}{|x|}\right\} } + \sum _{\min \left\{ bk, \frac{1}{|x|}\right\} < m \le bk}\right) . \end{aligned}$$

In the case \(|x| > 1\), the first sum is empty, so we can assume \(|x| \le 1\). We first find with Proposition 2.5 that

$$\begin{aligned} \sum _{m \le \min \left\{ bk, \frac{1}{|x|}\right\} } \zeta _{bk}^{m(ak+hjb)}\frac{1}{m}\phi _a(xm)&= G_{\min \left\{ bk, \frac{1}{|x|}\right\} }\left( \frac{a}{b} + \frac{hj}{k} \right) \phi _a\left( x \min \left\{ bk, \Big \lfloor \frac{1}{|x|} \Big \rfloor \right\} \right) \\&\quad + \sum _{m \le \min \left\{ bk, \frac{1}{|x|}\right\} - 1} G_{m}\left( \frac{a}{b} + \frac{hj}{k} \right) \left( \phi _a(mx) - \phi _a((m+1)x)\right) . \end{aligned}$$

It follows that with Lemma 5.8

$$\begin{aligned}&\left| \sum _{j=1}^k \sum _{m \le \min \left\{ bk, \frac{1}{|x|}\right\} } \zeta _b^{ma}\zeta _k^{mhj}\cdot \frac{1}{m}\phi _a(mx) \right| \le \sum _{j=1}^k \left| G_{\min \left\{ bk, \frac{1}{|x|}\right\} }\left( \frac{a}{b} + \frac{hj}{k} \right) \right| \left| \phi _a\left( x \min \left\{ bk, \Big \lfloor \frac{1}{|x|}\Big \rfloor \right\} \right) \right| \\&\qquad + \left| \sum _{j=1}^k \sum _{0< m \le \min \left\{ bk, \frac{1}{|x|}\right\} } G_{m}\left( \frac{a}{b} + \frac{hj}{k} \right) \left( \phi _a(mx) - \phi _a((m+1)x)\right) \right| \\&\quad \ll \sum _{j=1}^k \left| G_{\min \left\{ bk, \frac{1}{|x|}\right\} }\left( \frac{a}{b} + \frac{hj}{k} \right) \right| + \sum _{j=1}^k \max _{m=1, \ldots , \min \left\{ bk, \frac{1}{|x|}\right\} } \left| G_{m}\left( \frac{a}{b} + \frac{hj}{k} \right) \right| \sum _{0 < m \le \frac{1}{|x|}} |x| = O(k), \end{aligned}$$

where we used Lemma 2.10 and \(G_{bk}(1) = H_{bk} = O(\log (k))\) in the last step. Similarly, we find with Lemma 5.9 (without loss of generality we assume \(\frac{1}{|x|} < bk\))

$$\begin{aligned}&\left| \sum _{j=1}^k \sum _{\frac{1}{|x|}< m \le bk} \zeta _b^{ma}\zeta _{k}^{mhj}\cdot \frac{1}{m}\phi _a(mx) \right| \\&\quad \ll \sum _{j=1}^k \left| G_{bk}\left( \frac{a}{b} + \frac{hj}{k}\right) \right| \left| \phi _a\left( x bk \right) \right| + \left| \sum _{j=1}^k \sum _{\frac{1}{|x|}< m \le bk} G_{m}\left( \frac{a}{b} + \frac{hj}{k} \right) \left( \phi _a(mx) - \phi _a((m+1)x)\right) \right| \\&\quad \ll O(k) + \sum _{j=1}^k \max _{m=\frac{1}{|x|}, \ldots , bk} \left| G_{m}\left( \frac{a}{b} + \frac{hj}{k} \right) \right| \sum _{\frac{1}{|x|} < m \le bk} \left( \frac{1}{|x|m(m+1)} + |x| e^{-m \mathrm {Re}(x)} + a|x|e^{-am\mathrm {Re}(x)} \right) . \end{aligned}$$

Note that we uniformly have \(\phi _a(xbk) \ll 1\) (as \(1 \ll |xbk|\) and x is part of a fixed cone \(|\mathrm {Arg}(x)|\le \frac{\pi }{2}-\eta \)) as well as

$$\begin{aligned} \sum _{\frac{1}{|x|}< m \le bk} \frac{1}{|x|m(m+1)}&\le \sum _{\frac{1}{|x|}< m < \infty } \frac{1}{|x|m(m+1)} \ll 1 \end{aligned}$$

and

$$\begin{aligned} \sum _{\frac{1}{|x|} < m \le bk} |x| e^{-m \mathrm {Re}(x)}&\le \frac{|x|}{1-e^{-\mathrm {Re}(x)}} \ll 1, \end{aligned}$$

as \(\frac{|x|}{\mathrm {Re}(x)} \ll 1, |x| \ll 1.\) Similarly,

$$\begin{aligned} \sum _{\frac{1}{|x|} < m \le bk} a|x| e^{-am \mathrm {Re}(x)}&\ll 1. \end{aligned}$$

As a result, using Lemma 2.10 (again up to at most one summand in \(O(\log (k))\)),

$$\begin{aligned} \left| \sum _{j=1}^k \sum _{\frac{1}{|x|} < m \le bk} \zeta _b^{ma}\zeta _{k}^{mhj}\cdot \frac{1}{m}\phi _a(mx) \right|&\ll O(k) + \sum _{j=1}^k \max _{m=\frac{1}{|x|}, \ldots , bk} \left| G_{m}\left( \frac{a}{b} + \frac{hj}{k} \right) \right| = O(k), \end{aligned}$$

as claimed. \(\square \)