1. Introduction
Let $\zeta^3(s) = \sum_n \tau_3(n) n^{-s},\, \Re(s) \gt 1$. Determining full asymptotic for the shifted convolutions

for various ranges of h is an important problem in number theory in the past hundred years and is still wide open. We believe, however, that Equation (1.1) is too strong for applications. What we mean by that is the following. Suppose $\mathbf{(\mathrm{\textbf{A}})}$ and
$\mathbf{(\mathrm{\textbf{C}})}$ are two statements, possibly conjectures, with
$\mathbf{(\mathrm{\textbf{A}})} \implies \mathbf{(\mathrm{\textbf{C}})}$. We say that
$\mathbf{(\mathrm{\textbf{A}})}$ is ‘too strong’ for
$\mathbf{(\mathrm{\textbf{C}})}$ if there exists a statement
$\mathbf{(\mathrm{\textbf{B}})}$ such that (i)
$\mathbf{(\mathrm{\textbf{B}})}$ is easier to prove than
$\mathbf{(\mathrm{\textbf{A}})}$ and (ii) the following diagram of implications

holds. Thus, we propose the following modified weaker correlation sum:

where the length of the sum depends on the shift h. We show that this sum in Equation (1.2) is close to its expected value in an L 2 sense and that this is enough for certain problems.
More precisely, we prove, with a power-saving error term, that the second moment of Equation (1.2), namely:

is small, for a certain explicit main term $\mathrm{MT}(X, h)$. The main tool used in the proof is a trigonometric method of I. M. Vinogradov.
Second, as an application of the above bound (B), we obtain the full asymptotic for the variance of the ternary threefold divisor function in arithmetic progressions, averaged over all residue classes (not necessarily coprime) and moduli: there exist computable numerical constants $c_0, \dots, c_8$ such that

for some explicit main term $\mathrm{MT}(X; q, a)$. This result refines a related conjecture (see Conjecture 1.1) about the leading order asymptotic of a similar variance and improves a previously known upper bound by the author.
Quantities of the form (C) have their roots in the celebrated Bombieri–Vinogradov Theorem [Reference Bombieri4, Reference Vinogradov24], which, in one form, asserts that

where $\Lambda(n)$ is the von Mangoldt function and
$B=4A\,+\,40$ with A > 0 arbitrary. Analogues of Equation (1.3) have been found for all
$\tau_k(n)$ [Reference Nguyen19] and
$\tau_2(n)^2$ [Reference Motohashi16, Lemma 8], where
$\tau_k(n)$ is the k-fold divisor function:
$\sum_{n=1}^\infty \tau_k(n) n^{-s} = \zeta^k(s), \Re(s) \gt 1$. Around the same time, Barban [Reference Barban2, Reference Barban3], Davenport–Halberstam [Reference Davenport and Halberstam7] and Gallagher [Reference Gallagher9] found the following related inequality in which the absolute value is being squared:

giving a much wider range for q. In fact, Davenport and Halberstam proved a slightly stronger result than Barban’s, while Gallagher gave a simplified elegant proof. For this reason, this type of inequalities are often referred to as Barban–Davenport–Halberstam type inequalities.
Barban–Davenport–Halberstam type inequalities have many applications in number theory. For instance, a version of this inequality (with $\Lambda(n)$ replaced by related convolutions over primes) was skillfully used by Zhang [Reference Zhang25, Lemma 10] in his spectacular work on bounded gaps between primes.
In 1970, Montgomery [Reference Montgomery15] succeeded in replacing the inequality in Equation (1.4) by an asymptotic equality. Montgomery’s method is based on a result of Lavrik, which in turns relied on I. M. Vinogradov’s theory of exponential sums over primes. One of Montgomery’s results is

for $Q\le N$ and A > 0 arbitrary. A few years later, Hooley [Reference Hooley12], by introducing new ideas in treatment of the off-diagonal terms specific to primes, sharpened the right side of Equation (1.5) to

with $\Lambda(n)$ replaced by the Chebyshev function
$\theta(n)$.
Motohashi [Reference Motohashi17], by using an approach similar to Montgomery, elaborately established a more precise asymptotic with lower order and power saving error terms for the divisor function $\tau(n)$. Recently, by function field analogues, Rodgers and Soundararajan [Reference Rodgers and Soundararajan22] were led to an analogous conjecture for the leading order asymptotic of the variance of the k-fold divisor function τk over the integers. We state here a smoothed version of that conjecture formulated in [Reference Nguyen20, Conjecture 1].
Conjecture 1.1.
Let w(y) be a smooth function supported in $[1,2]$ with

and

uniformly for all $|\sigma| \le A$ for any fixed positive A > 0, for all positive integers
$\ell$, where
$\mathcal{M}[w]$ denotes the Mellin transform

of w. Then, for $X, d \to \infty$ such that
$({\log X}/{\log d}) \to c \in (0,k)$, we have

where


and $\gamma_k(c)$ is a piecewise polynomial of degree
$k^2 - 1$ defined by

with $\delta_c(x) = \delta(x-c)$ a Dirac delta function centred at c,
$\Delta(w) = \prod_{i \lt j} (w_i - w_j)$ a Vandermonde determinant, and G the Barnes G-function, so that in particular
$G(k + 1) =
(k - 1)! (k - 2)! \cdots 1!$.
In [Reference Rodgers and Soundararajan22], Rodgers and Soundararajan confirmed an averaged version of this conjecture in a restricted range over smooth cutoffs. Harper and Soundararajan [Reference Harper and Soundararajan11] obtained a lower bound of the right order of magnitude for the average of this variance. In [Reference Nguyen20], by using the functional equation for $L(s,\chi)$ and a multiplicative Voronoi summation formula, the author confirmed the asymptotic equation (1.6) for the restricted dual range
$k-1 \lt c \lt k$ for all k. By the large sieve inequality, the author also obtained in [Reference Nguyen19, Theorem 3] an upper bound of the same order of magnitude for this averaged variance.
The smoothed asymptotic equation (1.6) as well as the un-smoothed version are closely related to the problem of moments of Dirichlet L-functions [Reference Conrey and Gonek5] and correlations of divisor sums [Reference Conrey and Keating6]. This is due to the appearance of the factor $\gamma_k(c)$ in the leading order asymptotic in Equation (1.6). This piecewise polynomial ‘gamma-k-c’, as it is commonly referred to, is known to be connected with the geometric constants gk in the moment conjecture:

where

by the conjectural relation

We note that the coprimity condition $(a,d)=1$ in Equation (1.6) is essential for this phenomenon.
In summary, we obtain in this paper a new upper bound for the second moment of the error term of the modified shifted convolution of $\tau_3(n)$ in Theorem 2.1 and, as an application, apply this bound to obtain a full asymptotic with a power-saving error term for a variance of
$\tau_3(n)$ in arithmetic progressions in Theorem 2.2. The novelty of our results is the demonstration that a modified version of the original additive correlation sum is adequate for certain applications.
1.1. Notations
$\tau_k(n)$: the number of ways to write a natural number n as an ordered product of k positive integers.
$\tau(n) = \tau_2(n)$: the usual divisor function.
$\varphi(n)$: Euler’s function, i.e., the number of reduced residue classes modulo n.
$\zeta(s)$: Riemann’s zeta function with variable
$s=\sigma+i t$.
$\Gamma(s)$: Gamma function.
γ: Euler’s constant $= 0.5722 \dots$.
$\gamma_0(\alpha)$: 0th generalized Stieltjes constant:

$e(x)= e^{2\pi i x}.$
$e_q(a) = e^{2\pi i \frac{a}{q}}$.
$c_q(b)$: Ramanujan’s sum

(m, n): the greatest common divisor of m and n.
$[m,n]$: the least common multiple of m and n.
N: sufficiently large integer.
ɛ: arbitrary small positive constant, not necessarily the same in each occurrence.
$P_r(\log N)$: a polynomial of degree r in
$\log N$, not necessarily the same in each occurrence.
Throughout the paper, all constants in O-terms or in Vinogradov’s notation $\ll$ depends on ɛ at most.
2. Statement of results
Our main results are the following.
Theorem 2.1. We have, for sufficiently large N,

where $S_\Delta(k, N)$ is given by Equation (3.20) with
$\Delta = N^{4/19}$.
As an application, we apply Equation (2.1) to prove
Theorem 2.2. We have the following asymptotic equality, with effectively computable numerical constants $\mathfrak{S}_j,\ (0\le j\le 8)$,

where

2.1. Remarks
(1) Our bound (2.1) is an improvement of a related result of Baier et al. [Reference Baier, Browning, Marasingha and Zhao1], who proved an analogous estimate to Equation (2.1) but for correlations of τ 3 with fixed length and shifts up to
$N^{1-\varepsilon}$. More precisely, they proved in [Reference Baier, Browning, Marasingha and Zhao1, Theorem 2]: Assume that
$N^{1/3 + \varepsilon} \le H \le N^{1-\varepsilon}$. Then, there exists δ > 0 such that
for some main term\begin{equation*} \sum_{h\le H} \left| \sum_{N \lt n \le 2N} \tau_3(n) \tau_3(n+h) - \mathrm{MT_2}(N, h) \right|^2 \ll H N^{2- \delta}, \end{equation*}
$\mathrm{MT_2}(N, h)$.
(2) The expected main term (EMT)
$P_2(\log N)$ in Equation (2.2) is a certain polynomial of degree two in
$\log N$ whose coefficients can all be determined explicitly (c.f. Lemma 3.6):
where\begin{equation*} P_2(\log N) = \frac{1}{2} \tilde{A}\, \log^2 N - (\tilde{A}-\tilde{B})\log N + (\tilde{A}-\tilde{B}+\tilde{C}), \end{equation*}
\begin{equation*} \tilde{A} = \tilde{A}(\ell,b) = \ell^{-1} \sum_{q\mid \ell} q^{-3} c_q(b) \sum_{\alpha,\beta,\gamma=1}^q e_q(a\alpha \beta\gamma), \end{equation*}
\begin{equation*} \tilde{B} = \tilde{B}(\ell,b) = \ell^{-1} \sum_{q\mid \ell} q^{-3} c_q(b) \sum_{\alpha,\beta,\gamma=1}^q e_q(a\alpha \beta\gamma) (3\gamma_0(\alpha/q) - 3\,\log q), \end{equation*}
\begin{align*} \tilde{C} = \tilde{C}(\ell,b) & = \ell^{-1} \sum_{q\mid \ell} q^{-3} c_q(b) \sum_{\alpha,\beta,\gamma=1}^q e_q(a\alpha \beta\gamma) \\ & \qquad \left(3 \gamma_0(\alpha/q) \gamma_0(\beta/q) - 9\gamma_0(\alpha/q)\log q + \frac{9}{2} \,\log^2 q\right), \end{align*}
γ is Euler’s constant,
$\gamma_0(\alpha)$ is the 0th Stieltjes constant and
$c_q(b)$ is the Ramanujan sum. Different main terms are also considered by other authors. Our choice of EMT Equation (2.3) here differs from that of Equation (1.6) by an admissible amount which can be shown to be at most
$O(X^{2/3+\varepsilon})$. This has the harmless effect of changing lower order terms coefficients
$\mathfrak{S}_j$ in the asymptotic; see the discussion proceeding Lemma 4.17. Since our average over
$b (\textrm{mod } \ell)$ is over all residue classes not necessarily coprime to
$\ell$, the expression Equation (2.3) is the natural EMT to consider, as can readily be seen from its shape. When coprimality condition is imposed on
$b (\textrm{mod } \ell)$, the corresponding EMT is the one appearing in Equation (1.6); this EMT comes from the contribution of the principal character χ mod
$\ell$.
(3) The constants
$\mathfrak{S}_j, 0\le j\le 8,$ have complicated expressions but can be explicitly determined from our proof. We give here the value of the leading constant
$\mathfrak{S}_8$:
(2.4)\begin{equation} \mathfrak{S}_8 = \frac{1}{8!} \prod_p \left(1-9p^{-2} + 16 p^{-3} - 9 p^{-4} + p^{-6} \right) \approx 1.22326 \times 10^{-6}. \end{equation}
(4) T. Parry has recently informed us that he has succeeded in obtaining an asymptotic formula for all k for the quantity:
with power saving error terms.\begin{equation*} \sum_{q \lt Q} \sum_{a=1}^q \left|\sum_{n \lt x\atop {n=a(q)}} \tau_k(n)- \text{main term} \right|^2, \end{equation*}
His result is now available: By using a different method of Goldston and Vaughan [Reference Goldston and Vaughan10], Parry obtained in [Reference Parry21, Theorem 1] there is a quantity
$f_x(q, a)$, such that for fixed
$a, q \ge 1$,
and setting\begin{equation*} \sum_{\substack{n \le x\\ n \equiv a \pmod q}} \tau_k(n) \sim \frac{x}{q} f_x(q, a), \quad (x \to \infty), \end{equation*}
one has, for some polynomial\begin{eqnarray*} E_x(q,a)=\sum _{n\leq x\atop {n\equiv a(q)}}\tau_k(n)-\frac {xf_x(q,a)}{q}\qquad\text {and} \qquad V(x,Q)&=&\sum _{q\leq Q}\sum _{a=1}^q|E_x(q,a)|^2, \end{eqnarray*}
$P(\cdot,\cdot )$ of degree
$\leq k^2-1$ and
$1\leq Q=o(x)$,
(2.5)where\begin{align} V(x,Q)& =xQP(\log x,\log Q) \\ & \qquad +\mathcal O_{k,\varepsilon }\left (Q^2\left (\frac {x}{Q}\right )^{\mathfrak c}+\underbrace {x^{3/2+\varepsilon }}_{k=2}+\underbrace {x^{2-4/(6k-3)+\varepsilon }}_{k \gt 2}+Qx^{1-\mathfrak d+\varepsilon }\right), \end{align}
and\begin{equation*} \mathfrak{c} \in \begin{cases} (1/2 , 1), & \text{for } k=2, \\ ( 1- 1/k(k-2), 1 ), & \text{for } k \gt 2, \end{cases} \end{equation*}
$\mathfrak{d} \in (0,1)$ is any value for which we have
for some polynomial P of degree\begin{equation*} \sum_{n \le X} \tau_k(n)^2 = X P(\log X) + O_\varepsilon\left( X^{1-\mathfrak{d} + \varepsilon} \right), \end{equation*}
$k^2-1$. We view our endpoint estimate (2.2) a complement to (2.5) and vice versa for k = 3.
2.2. Outline of the proofs
We follow the approach of Motohashi [Reference Motohashi17] in his treatment of the divisor function $\tau(n)$, which in turn was based on Montgomery’s adaptation [Reference Montgomery15] of a result of Lavrik [Reference Lavrik14] on twin primes on average.
To control the error term, we prove an analog of Lavrik’s result for τ 3, using a simpler version of Vinogradov’s method of trigonometric sums, as in [Reference Motohashi17]. The standard convexity bound for $\zeta(s)$ in the critical strip suffices for our purpose. We remark here that our analogue of Lavrik’s result can be seen as an average result concerning the mean square error of the following modified additive divisor sum

of length N − h averaged over h up to $h\le N-1$. The advantage of considering Equation (2.6) is that the length of this sum becomes shorter the larger the shift h is, making contribution from large shifts small, so a power saving is possible when an average over h is taken. This idea might also have applications to the sixth power moment of
$\zeta(s)$, which we plan to revisit in the near future.
To evaluate the main term, we proceed slightly different from Motohashi due to some complications involving an exponential sum in three variables. We show that the resulting sum can be evaluated, on average, thanks to an orthogonality property of the Ramanujan’s sums.
3. Proof of Theorem 2.1
For σ > 1 and $(a,q)=1$, let

The case for the usual divisor function $\tau(n)$ was considered by Estermann (1930) who obtained analytic continuation and the functional equation for the corresponding generating function. Smith extended the result to all τk. We specialize to a special case his results.
Lemma 3.1. ([Reference Smith23, Theorem 1, pg. 258])
The function $E_3(s;a/q)$ has a meromorphic continuation to the whole complex plane where it is everywhere holomorphic except for a pole of order 3 at s = 1. Moreover,
$E(s;a/q)$ satisfies the functional equation:

where


and

We rewrite the functional equation (3.2) as follows (c.f. Ivic [Reference Ivić, Greaves, Harman and Huxley13]). Let

We have that

Then from Lemma 3.1, we obtain the following form of the functional equation.
Lemma 3.2. ([Reference Ivić, Greaves, Harman and Huxley13, Lemma 2, pg. 1007])
For σ < 0 and $(a,q)=1$, we have

where the two series on the right-side are absolutely convergent.
We also need the Laurent expansion of $E(s; a/q)$ at s = 1 for residue calculations. We first recall a lemma from Motohashi [Reference Motohashi17].
Lemma 3.3. We have, uniformly for any integer d,

Proof. See [Reference Motohashi17, Lemma 4.6.1, p. 193].
Lemma 3.4. For $(a,q) =1$, we have

where

with

The coefficients $A,B$ and C are independent of a and satisfy:

uniformly in a.
Proof. See Ivić [Reference Estermann8, pp. 1007–1008] for the Laurent expansion (3.4). In fact, Ivić also gave upper bound of the form q ɛ for $A,B$, and C which came from the bound:

We can sharpen this upper bound by applying Lemma 3.3 and bounding $\sum_{q \mid d} \frac{\varphi(q)}{q}$ by
$\log(q)$, giving:

Thus, noting that $\gamma_0(\alpha) \ll 1$ by Equation (3.5), the bound Equation (3.6) follows.
Lemma 3.5. For $n\ge 1$ and
$(a,q)=1$, we have:

where $A,B$ and C are given in Lemma 3.4.
Proof. We have, by Equation (3.4),

Lemma 3.6. For σ > 1, let

We have

where

with $A(q),B(q),C(q)$ given in Lemma 3.4.
Proof. We can write $R(s;\ell,b)$ as:

The lemma follows as in the previous one.
For $\alpha\in \mathbb{R}$, let

Using Equation (3.1) we first estimate $D(\alpha,N)$ for
$\alpha=a/q$ with
$(a,q)=1$.
Lemma 3.7. For $(a,q)=1$, we have

with $A,B,C$ given in Lemma 3.4.
Proof. We have

where $\delta= (\log(nq+1))^{-1}$ and T is to be determined latter. By expressing the residue as an integral around the origin,

By the functional equation (3.3) and the convexity argument,

uniformly for $-\delta \le \sigma \le 1+\delta$. Hence, we get

and

Taking

it follows from Equations (3.7), (3.9), (3.10), (3.11) and (3.12) that

Lemma 3.8. For $\alpha \in \mathbb{R}$, we have

with A, B and C given in Lemma 3.4.
Proof. We have

This, together with Lemma 3.7 and partial summation, gives Equation (3.13).
Let

and

where Δ satisfies

where Ω is the order of a Farey series (see $\S$ 3.1) and Δ is to be determined more precisely later; see Equation (3.30) below. By Lemma 3.8 and Equation (3.14),

Now, by Equations (3.14) and (3.15),

where

say. For the innermost sum in Equation (3.18), we have

Thus, we write Equation (3.18) as

say. Now, by Equation (3.8), we have

where

Thus,

and we obtain

with $D(\alpha,N)$,
$G_\Delta(\alpha,N)$,
$V(k,N)$ and
$S_\Delta(k,N)$ given by Equations (3.8), (3.15), (3.21) and (3.20), respectively.
This integral will be estimated in $\S$ 3.1 below.
Lemma 3.10. With

given from Equation (3.19), we have

Proof. For k > 0, by partial summation, we have

Similarly, we obtain the other Tj’s.
Lemma 3.11. We have, for any $(a,q)=1$ and ɛ > 0,

where the big-oh is independent of a.
Proof. See, e.g. [Reference Motohashi17, page 179, line -3].
We will apply Perron’s formula in the following form.
Lemma 3.12. Let $f(s) = \sum_{n=1}^\infty a_n n^{-s}$ be a Dirichlet series which converges absolutely for σ > 1. Suppose
$a_n = O(n^\varepsilon)$ for any ɛ > 0 and
$f(s) = \zeta(s)^\ell F(s)$ for some natural number
$\ell$ and some Dirichlet series F(s) which converges absolutely in
$\Re(s) \gt 1/2$. Then for X not an integer, we have

where $P_{\ell-1}(\log X)$ is the polynomial in
$\log X$ of degree
$\ell - 1$ with leading coefficient 1 given explicitly by

Proof. See [Reference Murty18, Problems 4.4.16, 4.4.17].
Lemma 3.13. We have

where $A_3 = 8! \mathfrak{S}_8$ with
$\mathfrak{S}_8$ given in Equation (2.4), and
$P_8(\log X)$ is a polynomial of degree 8 in
$\log X$ and leading coefficient 1.
Proof. We have

where both members of this equation are absolutely convergent if σ > 1. Hence, if σ > 1,

say, where

We adopt the convention for the binomial coefficients that $\binom{n}{m} = 0$ if m > n. We have
$a_2 = -9, a_3 = 16, a_4 = -9, a_5 = 0, a_6 = 1$ and
$a_\nu=0$ for
$\nu \ge 7$. The coefficient aν satisfies

where K is independent of ν. Hence,

where Kʹ is independent of p. Hence, if $\sigma \gt 1/2$, then
$\sum_p p^{-2s}$ is absolutely convergent, and thus is also

Hence we obtain that

where F(s) is absolutely convergent for $\sigma \gt 1/2$. It follows at once, by Lemma 3.12, that

where

Lemma 3.14. We have

and

Proof. Expanding into a geometric series and integrate by parts, we have

This gives the first integral. The second integral is computed in a similar way.
3.1. An analogue to a result of Lavrik
In this section we estimate the integral in Equation (3.22) by the trigonometric method of I.M. Vinogradov along the line of Lavrik, following Motohashi ($\S$ 3).
Let $a/q$ be a term of the Farey series of order Ω, which is to be determined later; see Equation (3.30) below. Let

be consecutive terms of the Farey series and let $C(a/q)$ be the interval
$\left[\frac{a^{\prime}+a}{q^{\prime}+q}, \frac{a+a^{\prime\prime}}{q+q^{\prime\prime}} \right]$. The interval
$C(a/q)$ contains the fraction
$a/q$ with length bounded by

Let

denote the integral in Equation (3.22). We proceed to estimate U(N). We have

say. For $U_1(N)$, we have, from Equation (3.17) and the inequality
$\left| |A|^2 - |B|^2 \right|^2 \le 4 |A-B|^2 ( |A|^2 + |B|^2 )$, valid for any complex numbers A and B, that

Thus, for $\alpha\in C(a/q)$, we have, by Equation (3.24), that the above is bounded by

and we get

For $U_2(N)$, we have, by Equation (3.15),

say. By Equation (3.14), we have

It remains to estimate $U_3(N)$. By partial summation, we can write
$F\left(\alpha, a^{\prime}/q^{\prime}, N \right)$ as

Thus,

The function $F\left(\alpha, a^{\prime}/q^{\prime}, N \right)$ has period 1 in α, and
$|a/q - (a^{\prime}/q^{\prime}\pm 1)| \le 1/2$. Thus,
$U_3(N)$ is at most

By Equation (3.16), we have, for $\alpha\in C(a/q)$,

for N sufficiently large. Hence,

where t(u) is the number of integer solutions to $|aq^{\prime}-qa^{\prime}|=u$ in the range of summation. We have

which yields

From Equations (3.22), (3.25), (3.26), (3.27), (3.28) and (3.29), we get the inequality

We now take, for example,

Then, the requirement Equation (3.16) is satisfied, and we have proved
Lemma 3.15. The inequality

holds for sufficiently large N.
4. Proof of theorem 2.2
Let Q(N) denote the sum on the left side of Equation (2.2). We have

say. We start with evaluating $Q_1(N)$, whose treatment is the most difficult of the 10. We have

where $V(k,N)$ is given by Equation (3.21). Here we have, by Lemma 3.13,

with A 3 and $P_8(\log N)$ given in that lemma. Now, by Lemma 3.15,

say. We now calculate $Q_{11}(N)$. By Equation (3.20), (3.19) and (3.23), we have

If q = 1, then

and, hence,

Thus,

To calculate the k-summations, we need to compute the following sums:

Assume q > 1. We now compute the first sum in Equation (4.6). By partial summation, we have

By the first part of Lemma 3.14, this is equal to

Thus,

Similar, by both parts of Lemma 3.14, we get

We now estimate $H_3(X)$. We have, by definition of the Ramanujan sums,

By Lemma 3.11, the inner sum is $q^{-1}
X \left(\log X -2 \,\log q + 2 \gamma -1 \right)
+
O_{\varepsilon} \left( (qX)^{\frac{1}{2} + \varepsilon} + q^{1+\varepsilon} \right)$. Thus,

The error term here is negligible. Using the above we get, by partial summation,

and

for some polynomials $P_2(\log N)$ and
$P_3(\log N)$ of degrees two and three in
$\log N$, respectively. Similarly, by partial summation we can easily obtain:

with numerical constants λj’s and some explicit polynomials $Q_1, Q_2$ and Q 3 of degrees one, two and three, respectively.
Here, we have

etc.
Collecting the wj’s, Tj’s and the Hj’s above, we deduce the following:
Lemma 4.17. There is an explicit polynomial $P_5(\log N)$ of degree 5 in
$\log N$ such that

Consequently, from Equations (4.2), (4.3), (4.4) and (4.5), we obtain that

With more effort, though tedious in details, one can calculate similar asymptotic expansions for $Q_2(N)$ to
$Q_{10}(N)$ in Equation (4.1). However, for our purpose, it suffices to bound the sums Q 2-Q 10 and show that they are smaller than the leading term
$N^2\, \log^8N$. Indeed, by Equation (3.6) and orthogonality of the Ramanujan sum
$c_q(b)$, we have that

We demonstrate one such bound for $Q_2(N)$ – the other bounds can be obtained similarly. Suppose first that q = 1. We have, in this case,
$\tilde{A}(\ell,b) = \ell^{-1}$ for any b, and hence

Assume next $q_1,q_2 \gt 1$. Suppose
$(q_1,q_2)=1$. Then

From this and Equation (3.6), we get

and, hence,

It remains to consider the case where $(q_1,q_2) \gt 1$. We have

Thus,

This, together with Equations (4.8) and (4.9), give that $Q_2(N)$ is at most
$O(N^2\, \log^6 N)$, verifying Equation (4.7) for
$Q_2(N)$.
As mentioned before, the estimates in Equation (4.7) are crude simply for the purpose of showing they do not contribute to the leading term. It is possible, by procedures analogous to the computations for $Q_1(N)$ and
$\sum_k W_q(k,N)$ demonstrated in the proof, to compute explicitly a polynomial
$P_6(\log N)$ of degree 6 in
$\log N$ such that:

We conclude, therefore, that Q(N), which is the left-hand side of Equation (2.2), is given by:

which gives the right-hand side of Equation (2.2). This completes the proof of the theorem.
Acknowledgements
The author thanks Soundararajan for pointing out the reference [Reference Harper and Soundararajan11] at an AIM FRG Seminar, which then motivated him to work on this problem, and B. Rodgers and J. Stopple for their interests in this project. This work was done while he was visiting the American Institute of Mathematics, virtually, which he is very grateful for their hospitality. He would also like to extend his gratitude to the referee for indicating a flaw in a lemma in a previous version and making useful suggestions.