# Generalized divisor functions in arithmetic progressions: II

D. T. Nguyen  Department of Mathematics & Statistics, Queen’s University, 48
University Ave (Jeffery Hall), Kingston, ON K7L 3N6, Canada.
<EMAIL_ADDRESS>
###### Abstract.

We obtain a new bound on the second moment of modified shifted convolutions of
the generalized 3-fold divisor function, and show that, for applications, the
modified version is sufficient.

###### Contents

  1. 1 Introduction
    1. 1.1 Notations
  2. 2 Statement of results
    1. 2.1 Remarks
    2. 2.2 Outline of the proofs
  3. 3 Proof of Theorem 2.1
    1. 3.1 An analogue to a result of Lavrik
  4. 4 Proof of theorem 2.2

##  1\. Introduction

Let $\zeta^{3}(s)=\sum_{n}\tau_{3}(n)n^{-s},\Re(s)>1$. Determining full
asymptotic for the shifted convolutions

(1.1) $\sum_{1\leq n\leq N}\tau_{3}(n)\tau_{3}(n+h)$

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 (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

(1.2)
${\mathbf{(\mathrm{\textbf{A}})}}$${\mathbf{(\mathrm{\textbf{B}})}}$${\mathbf{(\mathrm{\textbf{C}})}}$${\smallsetminus}$

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

(1.3) $\sum_{n\leq X-h}\tau_{3}(n)\tau_{3}(n+h),$

where the length of the sum depends on the shift $h$. We show that this sum
(1.3) 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 (1.3), namely

(B) $\sum_{h<X}\left(\sum_{n\leq
X-h}\tau_{3}(n)\tau_{3}(n+h)-\mathrm{MT}(X,h)\right)^{2}\ll X^{3-1/100},$

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.

Secondly, as an application of the above bound (B), we obtain the full
asymptotic for the variance of the ternary 3-fold 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

(C) $\sum_{q\leq X}\sum_{1\leq a\leq q}\left(\sum_{\begin{subarray}{c}n\leq
X\\\ n\equiv
a(q)\end{subarray}}\tau_{3}(n)-\mathrm{MT}(X;q,a)\right)^{2}=X^{2}(c_{8}\log^{8}X+\cdots+c_{0})+O\left(X^{2-1/300}\right),$

for some explicit main term $\mathrm{MT}(X;q,a)$. This result refines a
related conjecture (see conjecture 1.1 below) 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 [4] [24] (1965), which, in one form, asserts that

(1.4) $\sum_{1\leq q\leq N^{1/2}(\log N)^{-B}}\max_{y\leq
N}\max_{(a,q)=1}\left|\sum_{\begin{subarray}{c}1\leq n\leq y\\\ n\equiv
a(q)\end{subarray}}\Lambda(n)-\frac{y}{\varphi(y)}\right|\ll N(\log N)^{-A}$

where $\Lambda(n)$ is the von Mangoldt function and $B=4A+40$ with $A>0$
arbitrary. Analogues of (1.4) have been found for all $\tau_{k}(n)$ [19] and
$\tau_{2}(n)^{2}$ [16, 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)>1$. Around
the same time, Barban [2] [3] (1963-1964), Davenport-Halberstam [7] (1966),
and Gallagher [9] (1967) found the following related inequality in which the
absolute value is being squared:

(1.5) $\sum_{1\leq q\leq N(\log N)^{-B}}\sum_{\begin{subarray}{c}1\leq a\leq
q\\\ (a,q)=1\end{subarray}}\left|\sum_{\begin{subarray}{c}1\leq n\leq N\\\
n\equiv a(q)\end{subarray}}\Lambda(n)-\frac{N}{\varphi(q)}\right|^{2}\ll
N^{2}(\log N)^{-A},$

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 [25, Lemma
10] (2014) in his spectacular work on bounded gaps between primes.

In 1970, Montgomery [15] succeeded in replacing the inequality in (1.5) 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

(1.6) $\sum_{1\leq q\leq Q}\sum_{\begin{subarray}{c}1\leq a\leq q\\\
(a,q)=1\end{subarray}}\left|\sum_{\begin{subarray}{c}1\leq n\leq N\\\ n\equiv
a(q)\end{subarray}}\Lambda(n)-\frac{N}{\varphi(q)}\right|^{2}=QN\log
N+O(QN\log(2N/Q))+O\left(N^{2}(\log N)^{-A}\right)$

for $Q\leq N$ and $A>0$ arbitrary. A few years latter, Hooley [12] (1975), by
introducing new ideas in treatment of the off-diagonal terms specific to
primes, sharpened the right side of (1.6) to

(1.7) $QN\log N+O(QN)+O(N^{2}(\log N)^{-A}))$

with $\Lambda(n)$ replaced by the Chebyshev function $\theta(n)$.

Motohashi [17] (1973), 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 [22] (2018) were led to an analogous
conjecture for the leading order asymptotic of the variance of the $k$-fold
divisor function $\tau_{k}$ over the integers. We state here a smoothed
version of that conjecture formulated in [20, Conjecture 1].

######  Conjecture 1.1.

Let $w(y)$ be a smooth function supported in $[1,2]$ with

(1.8) $\int w(y)^{2}dy=1,$

and

(1.9) $\mathcal{M}[w](\sigma+it)\ll_{\ell}\frac{1}{(1+|t|)^{\ell}}$

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

(1.10) $\mathcal{M}[w](s)=\int_{0}^{\infty}w(x)x^{s-1}dx$

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

(1.11) $\sum_{\begin{subarray}{c}1\leq a\leq d\\\
(a,d)=1\end{subarray}}\left|\Delta_{w}(\tau_{k};X,d,a)\right|^{2}\sim
a_{k}(d)\gamma_{k}(c)X(\log d)^{k^{2}-1},$

where

(1.12) $\Delta_{w}(\tau_{k};X,d,a)=\sum_{n\equiv
a\pmod{d}}\tau_{k}(n)w\left(\frac{n}{X}\right)-\frac{1}{\varphi(d)}\sum_{(n,d)=1}\tau_{k}(n)w\left(\frac{n}{X}\right),$
(1.13) $a_{k}(d)=\lim_{s\to 1^{+}}(s-1)^{k^{2}}\sum_{\begin{subarray}{c}n=1\\\
(n,d)=1\end{subarray}}^{\infty}\frac{\tau_{k}(n)^{2}}{n^{s}},$

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

(1.14)
$\gamma_{k}(c)=\frac{1}{k!G(k+1)^{2}}\int_{[0,1]^{k}}\delta_{c}(w_{1}+\cdots
w_{k})\Delta(w)^{2}d^{k}w,$

with $\delta_{c}(x)=\delta(x-c)$ a Dirac delta function centered at $c$,
$\Delta(w)=\prod_{i<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 [22], Rodgers and Soundararajan confirmed an averaged version of this
conjecture in a restricted range over smooth cutoffs. Harper and Soundararajan
[11] obtained a lower bound of the right order of magnitude for the average of
this variance. In [20], by using the functional equation for $L(s,\chi)$ and a
multiplicative Voronoi summation formula, the author confirmed the asymptotic
(1.11) for the restricted dual range $k-1<c<k$ for all $k$. By the large sieve
inequality, the author also obtained in [19, Theorem 3] an upper bound of the
same order of magnitude for this averaged variance.

The smoothed asymptotic (1.11) as well as the un-smoothed version are closely
related to the problem of moments of Dirichlet $L$-functions [5] and
correlations of divisor sums [6]. This is due to the appearance of the factor
$\gamma_{k}(c)$ in the leading order asymptotic in (1.11). This piecewise
polynomial “gamma-k-c”, as it is commonly refered to, is known to be connected
with the geometric constants $g_{k}$ in the moment conjecture

(1.15) $\int_{0}^{T}\left|\zeta\left(\frac{1}{2}+it\right)\right|^{2k}dt\sim
a_{k}g_{k}T\frac{(\log T)^{k^{2}}}{k^{2}!},(T\to\infty),$

where

(1.16)
$a_{k}=\prod_{p}\left(1-\frac{1}{p}\right)^{(k-1)^{2}}\left(1+\frac{\binom{k-1}{1}^{2}}{p}+\frac{\binom{k-1}{2}^{2}}{p^{2}}+\cdots\right)$

by the conjectural relation

(1.17) $k^{2}!\int_{0}^{k}\gamma_{k}(c)dc=g_{k},\quad(k\geq 1).$

We note that the coprimity condition $(a,d)=1$ in (1.11) 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+it$.

$\Gamma(s)$: Gamma function.

$\gamma$: Euler’s constant $=0.5722\dots$.

$\gamma_{0}(\alpha)$: 0-th generalized Stieltjes constant

(1.18)
$\gamma_{0}(\alpha)=\lim_{m\to\infty}\left(\sum_{k=0}^{m}\frac{1}{k+\alpha}-\log(m+\alpha)\right).$

$e(x)=e^{2\pi ix}.$

$e_{q}(a)=e^{2\pi i\frac{a}{q}}$.

$c_{q}(b)$: Ramanujan’s sum

(1.19) $c_{q}(b)=\sum_{\begin{subarray}{c}1\leq a\leq q\\\
(a,q)=1\end{subarray}}e_{q}(ab).$

$(m,n)$: the greatest common divisor of $m$ and $n$.

$[m,n]$: the least common multiple of $m$ and $n$.

$N$: sufficiently large integer.

$\varepsilon$: 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 $\varepsilon$ at most.

##  2\. Statement of results

Our main results are the following.

######  THEOREM 2.1.

We have, for sufficiently large $N$,

(2.1) $\sum_{1\leq k<N}\left(\sum_{n\leq
N-k}\tau_{3}(n)\tau_{3}(n+k)-S_{\Delta}(k,N)\right)^{2}\ll N^{299/100},$

where $S_{\Delta}(k,N)$ is given by (3.57) below with $\Delta=N^{4/19}$.

As an application, we apply (2.1) to prove

######  THEOREM 2.2.

We have the following asymptotic equality, with effectively computable
numerical constants $\mathfrak{S}_{j},\ (0\leq j\leq 8)$,

(2.2) $\displaystyle\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\left|\sum_{\begin{subarray}{c}1\leq n\leq N\\\ n\equiv
b(\textrm{mod }\ell)\end{subarray}}\tau_{3}(n)-NP_{2}(\log
N)\right|^{2}=N^{2}\sum_{j=0}^{8}\mathfrak{S}_{8-j}\log^{8-j}N+O\left(N^{2-\frac{1}{300}}\right),$

where

(2.3) $P_{2}(\log N)=\underset{s=1}{\mathrm{Res}}\left\\{\sum_{n\equiv
b(\textrm{mod }\ell)}\frac{\tau_{3}(n)}{n^{s}}\frac{N^{s-1}}{s}\right\\}.$

###  2.1. Remarks

  1. (1)

Our bound (2.1) is an improvement of a related result of Baier, Browning,
Marasingha, and Zhao [1], who proved an analogous estimate to (2.1) but for
correlations of $\tau_{3}$ with fixed length and shifts up to
$N^{1-\varepsilon}$. More precisely, they proved in [1, Theorem 2]: Assume
that $N^{1/3+\varepsilon}\leq H\leq N^{1-\varepsilon}$. Then there exists
$\delta>0$ such that

(2.4) $\sum_{h\leq H}\left|\sum_{N<n\leq
2N}\tau_{3}(n)\tau_{3}(n+h)-\mathrm{MT_{2}}(N,h)\right|^{2}\ll HN^{2-\delta},$

for some main term $\mathrm{MT_{2}}(N,h)$.

  2. (2)

The expected main term (EMT) $P_{2}(\log N)$ in (2.2) is a certain polynomial
of degree two in $\log N$ whose coefficients can all be determined explicitly
(c.f. Lemma 3.6):

(2.5) $P_{2}(\log N)=\frac{1}{2}\tilde{A}\log^{2}N-(\tilde{A}-\tilde{B})\log
N+(\tilde{A}-\tilde{B}+\tilde{C}),$

where

(2.6)
$\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),$
(2.7)
$\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),$ (2.8)
$\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)(3\gamma_{0}(\alpha/q)\gamma_{0}(\beta/q)-9\gamma_{0}(\alpha/q)\log
q+\frac{9}{2}\log^{2}q),$

$\gamma$ is Euler’s constant, $\gamma_{0}(\alpha)$ is the 0-th Stieltjes
constant, and $c_{q}(b)$ is the Ramanujan sum. Different main terms are also
considered by other authors. Our choice of EMT (2.3) here differs from that of
(1.11) 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.2 below. Since our average over $b(\textrm{mod }\ell)$ is
over all residue classes not necessarily coprime to $\ell$, the expression
(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 (1.11); this EMT comes from the
contribution of the principal character $\chi$ mod $\ell$.

  3. (3)

The constants $\mathfrak{S}_{j},0\leq j\leq 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.9)
$\mathfrak{S}_{8}=\frac{1}{8!}\prod_{p}\left(1-9p^{-2}+16p^{-3}-9p^{-4}+p^{-6}\right)\approx
1.22326\times 10^{-6}.$

  4. (4)

T. Parry has recently informed us that he has succeeded in obtaining an
asymptotic formula for all $k$ for the quantity

(2.10)
$\sum_{q<Q}\sum_{a=1}^{q}\left|\sum_{n<x\atop{n=a(q)}}\tau_{k}(n)-\text{main
term}\right|^{2},$

with power saving error terms.

His result is now available: By using a different method of Goldston and
Vaughan [10], Parry obtained in [21, Theorem 1] there is a quantity
$f_{x}(q,a)$, such that for fixed $a,q\geq 1$,

(2.11) $\sum_{\begin{subarray}{c}n\leq x\\\ n\equiv
a\pmod{q}\end{subarray}}\tau_{k}(n)\sim\frac{x}{q}f_{x}(q,a),\quad(x\to\infty),$

and setting

$\displaystyle E_{x}(q,a)=\sum_{n\leq x\atop{n\equiv
a(q)}}\tau_{k}(n)-\frac{xf_{x}(q,a)}{q}\hskip 17.07164pt\text{ and }\hskip
17.07164ptV(x,Q)$ $\displaystyle=$ $\displaystyle\sum_{q\leq
Q}\sum_{a=1}^{q}|E_{x}(q,a)|^{2},$

one has, for some polynomial $P(\cdot,\cdot)$ of degree $\leq k^{2}-1$ and
$1\leq Q=o(x)$,

(2.12) $V(x,Q)=xQP(\log x,\log
Q)+\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>2}+Qx^{1-\mathfrak{d}+\varepsilon}\right),$

where

(2.13) $\mathfrak{c}\in\begin{cases}(1/2,1),&\text{ for }k=2,\\\
(1-1/k(k-2),1),&\text{ for }k>2,\end{cases}$

and $\mathfrak{d}\in(0,1)$ is any value for which we have

(2.14) $\sum_{n\leq X}\tau_{k}(n)^{2}=XP(\log
X)+O_{\varepsilon}\left(X^{1-\mathfrak{d}+\varepsilon}\right)$

for some polynomial $P$ of degree $k^{2}-1$. We view our endpoint estimate
(2.2) a complement to (2.12) and vice versa for $k=3$.

###  2.2. Outline of the proofs

We follow the approach of Motohashi [17] in his treatment of the divisor
function $\tau(n)$, which in turn was based on Montgomery’s adaptation [15] of
a result of Lavrik [14] on twin primes on average.

To control the error term, we prove an analog of Lavrik’s result for
$\tau_{3}$, using a simpler version of Vinogradov’s method of trigonometric
sums, as in [17]. 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

(2.15) $\sum_{1\leq n\leq N-h}\tau_{3}(n)\tau_{3}(n+h)$

of length $N-h$ averaged over $h$ up to $h\leq N-1$. The advantage of
considering (2.15) 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 $\sigma>1$ and $(a,q)=1$, let

(3.1)
$E\left(s;\frac{a}{q}\right)=E_{3}\left(s;\frac{a}{q}\right)=\sum_{n=1}^{\infty}\tau_{3}(n)e_{q}(an)n^{-s}.$

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 (1982) extended the result to all
$\tau_{k}$. We specialize to a special case his results.

######  LEMMA 3.1.

[23, 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

(3.2)
$E(s;a/q)=\left(\frac{q}{\pi}\right)^{-\frac{3}{2}(2s-1)}\frac{\Gamma^{3}\left(\frac{1-s}{2}\right)}{\Gamma^{3}(\frac{s}{2})}E^{+}(1-s;a/q)+i\left(\frac{q}{\pi}\right)^{\frac{3}{2}(2s-1)}\frac{\Gamma^{3}\left(\frac{2-s}{2}\right)}{\Gamma^{3}\left(\frac{1+s}{2}\right)}E^{-}(1-s;a/q),$

where

(3.3) $E^{\pm}(s;a/q)=\sum_{m_{1},m_{2},m_{3}\geq
1}G^{\pm}(m_{1},m_{2},m_{3};a/q)(m_{1}m_{2}m_{3})^{-s},\quad(\sigma>1),$ (3.4)
$G^{\pm}(m_{1},m_{2},m_{3};a/q)=\frac{1}{2q^{3/2}}\\{G(m_{1},m_{2},m_{3};a/q)\pm
G(m_{1},m_{2},m_{3};-a/q)\\},$

and

(3.5)
$G(m_{1},m_{2},m_{3};a/q)=\sum_{x_{1},x_{2},x_{3}(q)}e_{q}(am_{1}m_{2}m_{3}+m_{1}x_{1}+m_{2}x_{2}+m_{3}x_{3}).$

We rewrite the functional equation (3.2) as follows (c.f. Ivic [13]). Let

(3.6) $\displaystyle
A^{\pm}(n,a/q)=\sum_{n_{1}n_{2}n_{3}=n}\sum_{x_{1},x_{2},x_{3}=1}^{q}\frac{1}{2}$
$\displaystyle\big{(}e_{q}(ax_{1}x_{2}x_{3}+n_{1}x_{1}+n_{2}x_{2}+n_{3}x_{3})$
(3.7) $\displaystyle\pm
e_{q}(-ax_{1}x_{2}x_{3}+n_{1}x_{1}+n_{2}x_{2}+n_{3}x_{3})\big{)}.$

We have that

(3.8) $|A^{\pm}(n,a/q)|\leq q^{3}\tau_{3}(n).$

Then from Lemma 3.1 we obtain the following form of the functional equation.

######  LEMMA 3.2.

[13, Lemma 2, pg. 1007] For $\sigma<0$ and $(a,q)=1$, we have

(3.9)
$E(s;a/q)=\left(\frac{q}{\pi}\right)^{-\frac{3}{2}(2s-1)}\left\\{\frac{\Gamma^{3}\left(\frac{1-s}{2}\right)}{\Gamma^{3}\left(\frac{s}{2}\right)}\sum_{n=1}^{\infty}A^{+}(n,a/q)n^{s-1}+i\frac{\Gamma^{3}\left(\frac{2-s}{2}\right)}{\Gamma^{3}\left(\frac{1+s}{2}\right)}\sum_{n=1}^{\infty}A^{-}(n,a/q)n^{s-1}\right\\},$

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 [17].

######  LEMMA 3.3.

We have, uniformly for any integer $d$,

(3.10) $\sum_{1\leq m\leq y}\tau(dm)=y\sum_{q\mid d}\frac{\varphi(q)}{q}(\log
dy+2\gamma-1-2\log q)+O(\tau^{2}(d)y^{1/2}\log^{2}y).$

###### Proof.

See [17, Lemma 4.6.1, p. 193]. ∎

######  LEMMA 3.4.

For $(a,q)=1$, we have

(3.11)
$E(s;a/q)=\frac{1}{q}\left(\frac{A}{(s-1)^{3}}+\frac{B}{(s-1)^{2}}+\frac{C}{s-1}\right)+\sum_{n=0}^{\infty}c_{n}(a,q)(s-1)^{n},$

where

(3.12) $\displaystyle A$
$\displaystyle=A(q)=q^{-2}\sum_{\alpha,\beta,\gamma=1}^{q}e_{q}(a\alpha\beta\gamma),$
(3.13) $\displaystyle B$
$\displaystyle=B(q)=q^{-2}\sum_{\alpha,\beta,\gamma=1}^{q}e_{q}(a\alpha\beta\gamma)(3\gamma_{0}(\alpha/q)-3\log
q),$ (3.14) $\displaystyle C$
$\displaystyle=C(q)=q^{-2}\sum_{\alpha,\beta,\gamma=1}^{q}e_{q}(a\alpha\beta\gamma)(3\gamma_{0}(\alpha/q)\gamma_{0}(\beta/q)-9\gamma_{0}(\alpha/q)\log
q+\frac{9}{2}\log^{2}q),$

with

(3.15)
$\gamma_{0}(\alpha)=\lim_{m\to\infty}\left(\sum_{k=0}^{m}\frac{1}{k+\alpha}-\log(m+\alpha)\right).$

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

(3.16) $\displaystyle A(q)\ll\log^{2}q,\quad B(q)\ll\log^{3}q,\quad
C(q)\ll\log^{4}q,$

uniformly in $a$.

###### Proof.

See Ivić [8, pp. 1007-1008] for the Laurent expansion (3.11). In fact, Ivić
also gave upper bound of the form $q^{\varepsilon}$ for $A,B$, and $C$ which
came from the bound

(3.17) $\sum_{\alpha,\beta,\gamma=1}^{q}e_{q}(a\alpha\beta\gamma)\leq
q\sum_{1\leq\alpha\leq q}\tau(\alpha q)\ll q^{2+\varepsilon}.$

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

(3.18) $\sum_{\alpha,\beta,\gamma=1}^{q}e_{q}(a\alpha\beta\gamma)\leq
q\sum_{1\leq\alpha\leq q}\tau(\alpha q)\ll q^{2}\log^{2}q.$

Thus, noting that $\gamma_{0}(\alpha)\ll 1$ by (3.15), the bound (3.16)
follows. ∎

######  LEMMA 3.5.

For $n\geq 1$ and $(a,q)=1$, we have

(3.19) $\underset{s=1}{\mathrm{Res}}\
E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}=q^{-1}n\left(\frac{A}{2}\log^{2}n-(A-B)\log
n+(A-B+C)\right),$

where $A,B,C$ are given in Lemma 3.4.

###### Proof.

We have, by (3.11),

(3.20) $\displaystyle\underset{s=1}{\mathrm{Res}}\
E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}$
$\displaystyle=\frac{1}{2}\lim_{s\to
1}\frac{d^{2}}{ds^{2}}\left((s-1)^{3}E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}\right)$
(3.21) $\displaystyle=\frac{1}{2q}\lim_{s\to
1}\frac{d^{2}}{ds^{2}}\left((A+B(s-1)+C(s-1)^{2}+O((s-1)^{3}))\frac{n^{s}}{s}\right)$
(3.22) $\displaystyle=q^{-1}n\left(\frac{A}{2}\log^{2}n-(A-B)\log
n+(A-B+C)\right).$

∎

######  LEMMA 3.6.

For $\sigma>1$, let

(3.23) $R(s;\ell,b)=\sum_{n\equiv b(\textrm{mod }\ell)}\tau_{3}(n)n^{-s}.$

We have

(3.24) $\underset{s=1}{\mathrm{Res}}\
R(s;\ell,b)\frac{N^{s}}{s}=N\left(\frac{\tilde{A}}{2}\log^{2}N-(\tilde{A}-\tilde{B})\log
N+(\tilde{A}-\tilde{B}+\tilde{C})\right),$

where

(3.25) $\displaystyle\tilde{A}$
$\displaystyle=\tilde{A}(\ell,b)=\ell^{-1}\sum_{q\mid\ell}q^{-1}c_{q}(b)A(q),$
(3.26) $\displaystyle\tilde{B}$
$\displaystyle=\tilde{B}(\ell,b)=\ell^{-1}\sum_{q\mid\ell}q^{-1}c_{q}(b)B(q),$
(3.27) $\displaystyle\tilde{C}$
$\displaystyle=\tilde{C}(\ell,b)=\ell^{-1}\sum_{q\mid\ell}q^{-1}c_{q}(b)C(q),$

with $A(q),B(q),C(q)$ given in Lemma 3.4.

###### Proof.

We can write $R(s;\ell,b)$ as

(3.28) $\displaystyle R(s;\ell,b)$
$\displaystyle=\frac{1}{\ell}\sum_{q\mid\ell}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\ (a,q)=1\end{subarray}}e_{q}(-ab)E\left(s;\frac{a}{q}\right)$ (3.29)
$\displaystyle=\frac{1}{\ell}\sum_{q\mid\ell}\frac{1}{q}c_{q}(b)\left(\frac{A(q)}{(s-1)^{3}}+\frac{B(q)}{(s-1)^{2}}+\frac{C(q)}{s-1}\right)+\sum_{n=0}^{\infty}\frac{1}{\ell}\sum_{q\mid\ell}\frac{1}{q}c_{q}(b)c_{n}(a,q)(s-1)^{n}$
(3.30)
$\displaystyle=\frac{\tilde{A}(\ell,b)}{(s-1)^{3}}+\frac{\tilde{B}(\ell,b)}{(s-1)^{2}}+\frac{\tilde{C}(\ell,b)}{s-1}+\sum_{n=0}^{\infty}\frac{1}{\ell}\sum_{q\mid\ell}\frac{1}{q}c_{q}(b)c_{n}(a,q)(s-1)^{n}.$

The lemma follows as in the previous one. ∎

For $\alpha\in\mathbb{R}$, let

(3.31) $D(\alpha,N)=\sum_{1\leq n\leq N}\tau_{3}(n)e(\alpha n).$

Using (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

(3.32)
$D\left(\frac{a}{q},n\right)=\frac{n}{q}\left(\frac{A}{2}\log^{2}n-(A-B)\log
n+(A-B+C)\right)+O\left\\{(nq+q^{2})^{3/5+\varepsilon}\right\\},$

with $A,B,C$ given in Lemma 3.4.

###### Proof.

We have

(3.33) $\displaystyle D\left(\frac{a}{q},n\right)$
$\displaystyle=\underset{s=1}{\mathrm{Res}}\
E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}+\underset{s=0}{\mathrm{Res}}\
E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}+\frac{1}{2\pi i}\int_{-\delta-
iT}^{-\delta+iT}E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}ds$ (3.34)
$\displaystyle+O\left\\{\frac{n^{1+\varepsilon}}{T}+n^{\varepsilon}+\frac{1}{T}\int_{-\delta}^{1+\delta}\left|E\left(\sigma+iT;\frac{a}{q}\right)\right|n^{\sigma}d\sigma\right\\},$

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

(3.35) $\left|\underset{s=0}{\mathrm{Res}}\
E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}\right|\ll(\log(qn+1))^{3}.$

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

(3.36)
$\left|E\left(\sigma+iT;\frac{a}{q}\right)\right|\ll(qT)^{\frac{3}{2}(1-\sigma)}(\log
qT)^{6}$

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

(3.37) $\left|\frac{1}{2\pi i}\int_{-\delta-
iT}^{-\delta+iT}E\left(s;\frac{a}{q}\right)\frac{n^{s}}{s}ds\right|\ll(Tq)^{\frac{3}{2}}(\log
qT)^{7}$

and

(3.38)
$\frac{1}{T}\int_{-\delta}^{1+\delta}\left|E\left(\sigma+iT;\frac{a}{q}\right)\right|n^{\sigma}d\sigma\ll\frac{n}{T}(\log
qT)^{6}\int_{-\delta}^{1+\delta}\left(\frac{Tq}{n^{2/3}}\right)^{\frac{3}{2}(1-\sigma)}d\sigma.$

Taking

(3.39) $T=q^{-1}(nq+q^{2})^{2/5}$

it follows from (3.19), (3.33), (3.35), (3.37) and (3.38) that

(3.40)
$D\left(\frac{a}{q},n\right)=\frac{n}{q}\left(\frac{A}{2}\log^{2}n-(A-B)\log
n+(A-B+C)\right)+O\left\\{(nq+q^{2})^{3/5+\varepsilon}\right\\}.$

∎

######  LEMMA 3.8.

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

(3.41) $\displaystyle D(\alpha,N)$ $\displaystyle=\frac{1}{q}\sum_{1\leq n\leq
N}\left(\frac{A}{2}\log^{2}n-(A-B)\log
n+(A-B+C)\right)e\left(\left(\alpha-\frac{a}{q}\right)n\right)$ (3.42)
$\displaystyle+O\left\\{(Nq+q^{2})^{3/5+\varepsilon}\left(1+\left|\alpha-\frac{a}{q}\right|N\right)\right\\},$

with $A,B,C$ given in Lemma 3.4.

###### Proof.

We have

(3.43) $D(\alpha,N)=\sum_{1\leq n\leq
N}\left\\{D(a/q,n)-D(a/q,n-1)\right\\}e((\alpha-a/q)n).$

This, together with Lemma 3.7 and partial summation, gives (3.41). ∎

Let

(3.44) $F\left(\alpha,\frac{a}{q},N\right)=\frac{1}{q}\sum_{1\leq n\leq
N}\left(\frac{A}{2}\log^{2}n-(A-B)\log
n+(A-B+C)\right)e\left(\left(\alpha-\frac{a}{q}\right)n\right)$

and

(3.45) $G_{\Delta}(\alpha,N)=\sum_{1\leq
q\leq\Delta}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2},$

where $\Delta$ satisfies

(3.46) $4\Delta\leq\Omega,$

where $\Omega$ is the order of a Farey series (see section 3.1) and $\Delta$
is to be determined more precisely later; see (3.116) below. By Lemma 3.8 and
equation (3.44),

(3.47)
$\left|D(\alpha,N)-F(\alpha,a/q,N)\right|\ll(Nq+q^{2})^{3/5+\varepsilon}\left(1+\left|\alpha-\frac{a}{q}\right|N\right).$

Now, by (3.44) and (3.45),

(3.48) $G_{\Delta}(\alpha,N)=\sum_{|k|\leq N-1}e(\alpha k)\left(\sum_{1\leq
q\leq\Delta}\frac{1}{q^{2}}W_{q}(k,N)\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}e_{q}(-ak)\right),$

where

(3.49) $\displaystyle W_{q}(k,N)$ $\displaystyle=\frac{1}{4}A^{2}\sum_{1\leq
n\leq N-|k|}\log^{2}n\log^{2}(n+|k|)$ (3.50)
$\displaystyle-\frac{1}{2}A(A-B)\sum_{1\leq n\leq N-|k|}\log n\log(n+|k|)\log
n(n+|k|)$ (3.51) $\displaystyle+(A-B)^{2}\sum_{1\leq n\leq N-|k|}\log
n\log(n+|k|)$ (3.52) $\displaystyle-\frac{1}{2}A(A-B+C)\sum_{1\leq n\leq
N-|k|}(\log^{2}n+\log^{2}(n+|k|))$ (3.53)
$\displaystyle-(A-B)(A-B+C)\sum_{1\leq n\leq N-|k|}\log n(n+|k|)$ (3.54)
$\displaystyle+(A-B+C)^{2}(N-|k|)$ (3.55)
$\displaystyle=w_{1}(q)T_{1}(k,N)+\cdots+w_{6}(q)T_{6}(k,N),$

say. For the innermost sum in (3.48) we have

(3.56) $\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}e_{q}(-ak)=\mu\left(\frac{q}{(q,|k|)}\right)\frac{\varphi(q)}{\varphi\left(\frac{q}{(q,|k|)}\right)}=c_{q}(|k|).$

Thus we write (3.48) as

(3.57) $G_{\Delta}(\alpha,N)=\sum_{|k|\leq N-1}\left(\sum_{1\leq
q\leq\Delta}q^{-2}c_{q}(|k|)W_{q}(k,N)\right)e(\alpha k)=\sum_{|k|\leq
N-1}S_{\Delta}(k,N)e(\alpha k),$

say. Now, by (3.31), we have

(3.58) $|D(\alpha,N)|^{2}=\sum_{|k|\leq N-1}V(k,N)e(\alpha k),$

where

(3.59) $V(k,N)=\sum_{1\leq n\leq N-|k|}\tau_{3}(n)\tau_{3}(n+|k|).$

Thus,

(3.60) $|D(\alpha,N)|^{2}-G_{\Delta}(\alpha,N)=\sum_{|k|\leq
N-1}(V(k,N)-S_{\Delta}(k,N))e(\alpha k).$

and we obtain

######  LEMMA 3.9.

(3.61) $\sum_{|k|\leq
N-1}\left(V(k,N)-S_{\Delta}(k,N)\right)^{2}=\int_{0}^{1}\left||D(\alpha,N)|^{2}-G_{\Delta}(\alpha,N)\right|^{2}d\alpha,$

with $D(\alpha,N)$, $G_{\Delta}(\alpha,N)$, $V(k,N)$, and $S_{\Delta}(k,N)$
given by (3.31), (3.45), (3.59), and (3.57), respectively.

This integral will be estimated in Section 3.1 below.

######  LEMMA 3.10.

With

(3.62) $\displaystyle T_{1}(k,N)$ $\displaystyle=\sum_{1\leq n\leq
N-|k|}\log^{2}n\log^{2}(n+|k|),$ (3.63) $\displaystyle T_{2}(k,N)$
$\displaystyle=\sum_{1\leq n\leq N-|k|}\log n\log(n+|k|)\log(n(n+|k|)),$
(3.64) $\displaystyle T_{3}(k,N)$ $\displaystyle=\sum_{1\leq n\leq N-|k|}\log
n\log(n+|k|),$ (3.65) $\displaystyle T_{4}(k,N)$ $\displaystyle=\sum_{1\leq
n\leq N-|k|}(\log^{2}n+\log^{2}(n+|k|)),$ (3.66) $\displaystyle T_{5}(k,N)$
$\displaystyle=\sum_{1\leq n\leq N-|k|}\log(n(n+|k|)).$

given from (3.49), we have

(3.67) $\displaystyle T_{1}(k,N)$
$\displaystyle=(N-|k|)\log^{2}N\log^{2}(N-|k|)+O(N\log^{3}N),$ (3.68)
$\displaystyle T_{2}(k,N)$ $\displaystyle=(N-|k|)(\log^{2}N\log(N-|k|)+\log
N\log^{2}(N-|k|))+O(N\log^{2}N),$ (3.69) $\displaystyle T_{3}(k,N)$
$\displaystyle=(N-|k|)\log N\log(N-|k|)+O(N\log N),$ (3.70) $\displaystyle
T_{4}(k,N)$ $\displaystyle=(N-|k|)(\log^{2}N+\log^{2}(N-|k|))+O(N\log N),$
(3.71) $\displaystyle T_{5}(k,N)$ $\displaystyle=(N-|k|)(\log
N+\log(N-|k|))+O(N).$

###### Proof.

For $k>0$, by partial summation, we have

(3.72) $T_{5}(k,N)=(N-k)\log(N-k)+N\log N-k\log k-2(N-k)+O(\log N).$

Similarly, we obtain the other $T_{j}$’s. ∎

######  LEMMA 3.11.

We have, for any $(a,q)=1$ and $\varepsilon>0$,

(3.73) $\sum_{n\leq X}\tau(n)e_{q}(an)=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),$

where the big-oh is independent of $a$.

###### Proof.

See, e.g., [17, 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 $\sigma>1$. Suppose $a_{n}=O(n^{\varepsilon})$ for
any $\varepsilon>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)>1/2$. Then for $X$ not an integer, we have

(3.74) $\sum_{n\leq X}a_{n}=\frac{F(1)}{(\ell-1)!}XP_{\ell-1}(\log
X)+O_{\varepsilon}\left(X^{1-\frac{1}{\ell+2}}\right),$

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

(3.75) $P_{\ell-1}(\log
X)=(\ell-1)!Res_{s=1}\zeta(s)^{\ell}F(s)\frac{X^{s-1}}{s}.$

###### Proof.

See [18, Problems 4.4.16, 4.4.17]. ∎

######  LEMMA 3.13.

We have

(3.76) $\sum_{n\leq X}\tau_{3}^{2}(n)=\frac{A_{3}}{8!}XP_{8}(\log
X)+O\left(X^{10/11}\right),$

where $A_{3}=8!\mathfrak{S}_{8}$ with $\mathfrak{S}_{8}$ given in (2.9), and
$P_{8}(\log X)$ is a polynomial of degree 8 in $\log X$ and leading
coefficient 1.

###### Proof.

We have

(3.77)
$\sum_{n=1}^{\infty}\tau_{3}^{2}(n)n^{-s}=\prod_{p}\left\\{1+\sum_{\nu=1}^{\infty}\binom{\nu+2}{2}^{2}p^{-\nu
s}\right\\},$

where both members of this equation are absolutely convergent if $\sigma>1$.
Hence, if $\sigma>1$,

(3.78)
$\displaystyle\left\\{\zeta(s)\right\\}^{-9}\left\\{\sum_{n=1}^{\infty}\tau_{3}^{2}(n)n^{-s}\right\\}$
$\displaystyle=\prod_{p}\left\\{(1-p^{-s})^{9}(1+9p^{-s}+36p^{-2s}+\cdots)\right\\}$
(3.79)
$\displaystyle=\prod_{p}\left\\{1+a_{2}p^{-2s}+a_{3}p^{-3s}+\cdots\right\\}=F(s),$

say, where

(3.80) $a_{\nu}=\sum_{r=0}^{\nu}(-1)^{r}\binom{9}{r}\binom{\nu-r+2}{2}^{2}.$

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\geq 7$. The coefficient $a_{\nu}$ satisfies

(3.81) $|a_{\nu}|\leq K\nu^{2},$

where $K$ is independent of $\nu$. Hence

(3.82) $\sum_{\nu=2}^{\infty}|a_{\nu}|p^{-\nu s}\leq K^{\prime}p^{-2s},$

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

(3.83) $F(s)=\prod_{p}\left\\{1+\sum_{\nu=2}^{\infty}a_{\nu}p^{-\nu
s}\right\\}.$

Hence we obtain that

(3.84)
$\sum_{n=1}^{\infty}\tau_{3}^{2}(n)n^{-s}=\left\\{\zeta(s)\right\\}^{9}F(s),$

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

(3.85) $\sum_{n\leq X}\tau_{3}^{2}(n)=\frac{A_{3}}{8!}XP_{8}(\log
X)+O\left(X^{10/11}\right),$

where

$A_{3}=F(1)=\prod_{p}\left(1-9p^{-2}+16p^{-3}-9p^{-4}+p^{-6}\right).$

∎

######  LEMMA 3.14.

We have

(3.86) $\int_{1}^{N-1}\frac{t\log t}{N-t}dt=N\left(\log^{2}N-\log
N-\frac{\pi^{2}}{6}+1\right)+O(\log N)$

and

(3.87)
$\int_{1}^{N-1}\frac{t\log^{2}t}{N-t}dt=N\left(\log^{3}N-2\log^{2}N-\left(\frac{\pi^{2}}{3}-2\right)\log
N+2\zeta(3)-2\right)+O(\log^{2}N).$

###### Proof.

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

(3.88) $\displaystyle\int_{1}^{N-1}\frac{t\log t}{N-t}dt$
$\displaystyle=\sum_{m=1}^{\infty}\frac{1}{N^{m}}\int_{1}^{N-1}t^{m}\log tdt$
(3.89)
$\displaystyle=N\log(N-1)\sum_{m=1}^{\infty}\frac{1}{m+1}\left(\frac{N-1}{N}\right)^{m+1}-N\sum_{m=1}^{\infty}\frac{1}{(m+1)^{2}}\left(\frac{N-1}{N}\right)^{m+1}+O(1)$
(3.90) $\displaystyle=N\left(\log^{2}N-\log
N-\frac{\pi^{2}}{6}+1\right)+O(\log N).$

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 (3.61) by the trigonometric method
of I.M. Vinogradov along the line of Lavrik, following Motohashi (section 3).

Let $a/q$ be a term of the Farey series of order $\Omega$, which is to be
determined later; see (3.116) below. Let

(3.91)
$\frac{a^{\prime}}{q^{\prime}},\frac{a}{q},\frac{a^{\prime\prime}}{q^{\prime\prime}}$

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

(3.92) $\left|C\left(\frac{a}{q}\right)\right|\leq\frac{2}{q\Omega}.$

Let

(3.93)
$U(N)=\int_{0}^{1}\left||D(\alpha,N)|^{2}-G_{\Delta}(\alpha,N)\right|^{2}d\alpha$

denote the integral in (3.61). We proceed to estimate $U(N)$. We have

(3.94) $\displaystyle U(N)$ $\displaystyle=\sum_{1\leq
q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{C(a/q)}\left||D(\alpha,N)|^{2}-G_{\Delta}(\alpha,N)\right|^{2}d\alpha$
(3.95) $\displaystyle\leq 2\sum_{1\leq
q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{C(a/q)}\left||D(\alpha,N)|^{2}-\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2}\right|^{2}d\alpha$
(3.96) $\displaystyle+2\sum_{1\leq q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{C(a/q)}\left|G_{\Delta}(\alpha,N)-\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2}\right|^{2}d\alpha$
(3.97) $\displaystyle=U_{1}(N)+U_{2}(N),$

say. For $U_{1}(N)$, we have, from (3.47) and the inequality
$\left||A|^{2}-|B|^{2}\right|^{2}\leq 4|A-B|^{2}(|A|^{2}+|B|^{2})$, valid for
any complex numbers $A$ and $B$, that

(3.98)
$\left||D(\alpha,N)|^{2}-\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2}\right|^{2}\ll(Nq+q^{2})^{\frac{6}{5}+2\varepsilon}\left(1+\left|\alpha-\frac{a}{q}\right|^{2}N^{2}\right)\left(|D(\alpha,N)|^{2}+\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2}\right).$

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

(3.99)
$\displaystyle\left((N\Omega)^{\frac{6}{5}+2\varepsilon}+\Omega^{\frac{12}{5}+4\varepsilon}+\frac{N^{\frac{16}{5}+2\varepsilon}}{\Omega^{2}}+\frac{N^{2}}{\Omega^{\frac{8}{5}-4\varepsilon}}\right)\left(|D(\alpha,N)|^{2}+\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2}\right),$

and we get

(3.100) $\displaystyle U_{1}(N)$
$\displaystyle\ll\left((N\Omega)^{\frac{6}{5}+2\varepsilon}+\Omega^{\frac{12}{5}+4\varepsilon}+\frac{N^{\frac{16}{5}+2\varepsilon}}{\Omega^{2}}+\frac{N^{2}}{\Omega^{\frac{8}{5}-4\varepsilon}}\right)$
(3.101)
$\displaystyle\quad\quad\times\left\\{\int_{0}^{1}|D(\alpha,N)|^{2}d\alpha+\sum_{1\leq
q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{0}^{1}\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{2}d\alpha\right\\}$
(3.102)
$\displaystyle\ll\left((N\Omega)^{\frac{6}{5}+2\varepsilon}+\Omega^{\frac{12}{5}+4\varepsilon}+\frac{N^{\frac{16}{5}+2\varepsilon}}{\Omega^{2}}+\frac{N^{2}}{\Omega^{\frac{8}{5}-4\varepsilon}}\right)N\log^{8}N.$

For $U_{2}(N)$, we have, by (3.45),

(3.103) $\displaystyle U_{2}(N)$ $\displaystyle\ll\sum_{1\leq
q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{C(a/q)}\left|\sum_{1\leq
q^{\prime}\leq\Delta}\sum_{\begin{subarray}{c}a^{\prime}=1\\\
(a^{\prime},q^{\prime})=1\\\ a^{\prime}q\neq
aq^{\prime}\end{subarray}}^{q^{\prime}}\left|F\left(\alpha,\frac{a^{\prime}}{q^{\prime}},N\right)\right|^{2}\right|^{2}d\alpha$
(3.104)
$\displaystyle+\sum_{\Delta<q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{C(a/q)}\left|F\left(\alpha,\frac{a}{q},N\right)\right|^{4}d\alpha$
(3.105) $\displaystyle=U_{3}(N)+U_{4}(N),$

say. By (3.44), we have

(3.106)
$U_{4}(N)\ll\frac{(N\log^{2}N)^{4}}{\Omega}\sum_{\Delta<q\leq\Omega}\frac{1}{q^{4}}\ll\frac{N^{4}\log^{8}N}{\Omega\Delta^{3}}.$

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

(3.107) $\displaystyle\frac{1}{q^{\prime}}$
$\displaystyle\Large(A(a^{\prime},q^{\prime})\log^{2}N+(B(a^{\prime},q^{\prime})-2A(a^{\prime},q^{\prime}))\log
N+2A(a^{\prime},q^{\prime})-B(a^{\prime},q^{\prime})$ (3.108)
$\displaystyle+C(a^{\prime},q^{\prime})\Large)\sum_{1\leq n\leq
N}e\left(\left(\alpha-\frac{a^{\prime}}{q^{\prime}}\right)n\right)-\frac{1}{q^{\prime}}\int_{1}^{N}\left(\frac{2A\log\xi}{\xi}+\frac{B-2A}{\xi}\right)\sum_{1\leq
n\leq\xi}e\left(\left(\alpha-\frac{a^{\prime}}{q^{\prime}}\right)n\right)d\xi.$

Thus,

(3.109)
$\left|F\left(\alpha,\frac{a^{\prime}}{q^{\prime}},N\right)\right|\ll\frac{q^{\prime\varepsilon}\log^{3}N}{q^{\prime}\left|\sin\pi\left(\alpha-\frac{a^{\prime}}{q^{\prime}}\right)\right|}.$

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

(3.110) $\ll\Delta^{2}\log^{12}N\sum_{1\leq
q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\int_{C(a/q)}\sum_{1\leq
q^{\prime}\leq\Delta}\sum_{\begin{subarray}{c}a^{\prime}=-q^{\prime}\\\
(a^{\prime},q^{\prime})=1\\\
0<\left|\frac{a^{\prime}}{q^{\prime}}-\frac{a}{q}\right|\leq\frac{1}{2}\end{subarray}}^{2q^{\prime}}\frac{q^{\prime\varepsilon}}{q^{\prime
4}\left|\sin\pi\left(\alpha-\frac{a^{\prime}}{q^{\prime}}\right)\right|^{4}}d\alpha.$

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

(3.111)
$\frac{1}{2}\left|\frac{a}{q}-\frac{a^{\prime}}{q^{\prime}}\right|\leq\left|\alpha-\frac{a^{\prime}}{q^{\prime}}\right|\leq\frac{3}{4}$

for $N$ sufficiently large. Hence,

(3.112) $U_{3}(N)\ll\Omega^{2}\Delta^{2}\log^{12}N\sum_{1\leq
q\leq\Omega}\sum_{\begin{subarray}{c}a=1\\\
(a,q)=1\end{subarray}}^{q}\sum_{1\leq
q^{\prime}\leq\Delta}q^{\prime\varepsilon}\sum_{\begin{subarray}{c}a^{\prime}=-q^{\prime}\\\
(a^{\prime},q^{\prime})=1\\\ a^{\prime}q\neq
aq^{\prime}\end{subarray}}^{2q^{\prime}}\frac{1}{|aq^{\prime}-qa^{\prime}|^{4}}\ll\Omega^{2+\varepsilon}\Delta^{2}\log^{12}N\sum_{u=1}^{\infty}\frac{t(u)}{u^{4}},$

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

(3.113) $t(u)\ll\Delta^{2}\Omega$

which yields

(3.114) $U_{3}(N)\ll\Omega^{3+\varepsilon}\Delta^{4}\log^{12}N.$

From (3.61), (3.94), (3.100), (3.103), (3.106) and (3.114), we get the
inequality

(3.115) $\sum_{1\leq k\leq N-1}(V(k,N)-S_{\Delta}(k,N))^{2}\ll
N^{\varepsilon}\left(N^{11/5}\Omega^{6/5}+\Omega^{12/5}N+\frac{N^{21/5}}{\Omega^{2}}+\frac{N^{3}}{\Omega^{8/5}}+\Omega^{3}\Delta^{4}+\frac{N^{4}}{\Omega\Delta^{3}}\right).$

We now take, for example,

(3.116) $\Omega=N^{{25/38}}\quad\text{and}\quad\Delta=N^{4/19}.$

Then the requirement (3.46) is satisfied, and we have proved

######  LEMMA 3.15.

The inequality

(3.117) $\sum_{1\leq k\leq N-1}(V(k,N)-S_{\Delta}(k,N))^{2}\ll N^{299/100}$

holds for sufficiently large $N$.

##  4\. Proof of theorem 2.2

Let $Q(N)$ denote the sum on the left side of (2.2). We have

(4.1) $\displaystyle Q(N)$ $\displaystyle=\sum_{1\leq\ell\leq
N}\sum_{\begin{subarray}{c}1\leq n_{1},n_{2}\leq N\\\ n_{1}\equiv
n_{2}(\textrm{mod }\ell)\end{subarray}}\tau_{3}(n_{1})\tau_{3}(n_{2})$ (4.2)
$\displaystyle+\frac{1}{4}N^{2}\log^{4}N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\tilde{A}(\ell,b)^{2}$ (4.3)
$\displaystyle-N^{2}\log^{3}N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)^{2}-\tilde{A}(\ell,b)\tilde{B}(\ell,b))$ (4.4)
$\displaystyle+N^{2}\log^{2}N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)^{2}-2\tilde{A}(\ell,b)\tilde{B}+\tilde{B}(\ell,b)^{2})$
(4.5) $\displaystyle+N^{2}\log^{2}N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)^{2}-\tilde{A}(\ell,b)\tilde{B}(\ell,b)+\tilde{A}(\ell,b)\tilde{C}(\ell,b))$
(4.6) $\displaystyle+2N^{2}\log^{2}N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)^{2}+\tilde{B}(\ell,b)^{2}-2\tilde{A}(\ell,b)\tilde{B}(\ell,b)-\tilde{B}(\ell,b)\tilde{C}(\ell,b)+\tilde{A}(\ell,b)\tilde{C}(\ell,b))$
(4.7) $\displaystyle+N^{2}\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)^{2}+\tilde{B}(\ell,b)^{2}+\tilde{C}(\ell,b)^{2}-2\tilde{A}(\ell,b)\tilde{B}(\ell,b)+2\tilde{A}(\ell,b)\tilde{C}(\ell,b)-2\tilde{B}(\ell,b)\tilde{C}(\ell,b))$
(4.8) $\displaystyle-N\log^{2}N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\tilde{A}(\ell,b)\sum_{\begin{subarray}{c}1\leq n\leq N\\\ n\equiv
b(\ell)\end{subarray}}\tau_{3}(n)$ (4.9) $\displaystyle+2N\log
N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)-\tilde{B}(\ell,b))\sum_{\begin{subarray}{c}1\leq
n\leq N\\\ n\equiv b(\ell)\end{subarray}}\tau_{3}(n)$ (4.10)
$\displaystyle+2N\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}(\tilde{A}(\ell,b)-\tilde{B}(\ell,b)+\tilde{C}(\ell,b))\sum_{\begin{subarray}{c}1\leq
n\leq N\\\ n\equiv b(\ell)\end{subarray}}\tau_{3}(n)$ (4.11)
$\displaystyle=Q_{1}(N)+\cdots+Q_{10}(N),$

say. We start with evaluating $Q_{1}(N)$, whose treatment is the most
difficult of the ten. We have

(4.12) $\displaystyle Q_{1}(N)$ $\displaystyle=N\sum_{1\leq n\leq
N}\tau_{3}^{2}(n)+2\sum_{1\leq\ell\leq N-1}\ \sum_{1\leq u\leq(N-1)/\ell}\
\sum_{1\leq n\leq N-u\ell}\ \tau_{3}(n)\tau_{3}(n+u\ell)$ (4.13)
$\displaystyle=N\sum_{1\leq n\leq N}\tau_{3}^{2}(n)+2\sum_{1\leq k\leq
N-1}V(k,N)\tau(k),$

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

(4.14) $\sum_{n\leq N}\tau_{3}^{2}(n)=\frac{A_{3}}{8!}NP_{8}(\log
N)+O\left(N^{10/11}\right)$

with $A_{3}$ and $P_{8}(\log N)$ given in that lemma. Now, by Lemma 3.15,

(4.15) $\displaystyle\sum_{1\leq k\leq N-1}V(k,N)\tau(k)$
$\displaystyle=\sum_{1\leq k\leq N-1}S_{\Delta}(k,N)\tau(k)$ (4.16)
$\displaystyle+O\left\\{\left(\sum_{1\leq k\leq
N-1}\tau^{2}(k)\right)^{1/2}\left(\sum_{1\leq k\leq
N-1}(V(k,N)-S_{\Delta}(k,N))^{2}\right)^{1/2}\right\\}$ (4.17)
$\displaystyle=\sum_{1\leq k\leq
N-1}S_{\Delta}(k,N)\tau(k)+O\left(N^{599/300}\right)=Q_{11}(N)+O\left(N^{599/300}\right),$

say. We now calculate $Q_{11}(N)$. By (3.57), (3.49), and (3.62), we have

(4.18) $Q_{11}(N)=\sum_{j=1}^{6}\sum_{1\leq
q\leq\Delta}q^{-2}w_{j}(q)\sum_{1\leq k\leq N-1}\tau(k)c_{q}(k)T_{j}(k,N).$

If $q=1$, then

(4.19) $c_{1}(k)=1,\ A(1)=1,\ B(1)=3\gamma,\ C(1)=3\gamma^{2},$

and, hence,

(4.20) $\displaystyle w_{1}(1)$ $\displaystyle=\frac{1}{4},$ (4.21)
$\displaystyle w_{2}(1)$ $\displaystyle=\frac{1}{2}(3\gamma-1),$ (4.22)
$\displaystyle w_{3}(1)$ $\displaystyle=(1-3\gamma)^{2},$ (4.23)
$\displaystyle w_{4}(1)$ $\displaystyle=-\frac{1}{2}(1-3\gamma+3\gamma^{2}),$
(4.24) $\displaystyle w_{5}(1)$
$\displaystyle=(3\gamma-1)(1-3\gamma-3\gamma^{2}),$ (4.25) $\displaystyle
w_{6}(1)$ $\displaystyle=(1-3\gamma+3\gamma^{2})^{2}.$

Thus,

(4.26) $\displaystyle Q_{11}(N)$
$\displaystyle=\sum_{j=1}^{6}w_{j}(1)\sum_{1\leq k\leq N-1}\tau(k)T_{j}(k,N)$
(4.27)
$\displaystyle+\sum_{j=1}^{6}\sum_{1<q\leq\Delta}q^{-2}w_{j}(q)\sum_{1\leq
k\leq N-1}\tau(k)c_{q}(k)T_{j}(k,N).$

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

(4.28) $\displaystyle H_{1}(N)$ $\displaystyle=\sum_{1\leq k\leq
N-1}\tau(k)\log(N-k),$ (4.29) $\displaystyle H_{2}(N)$
$\displaystyle=\sum_{1\leq k\leq N-1}\tau(k)\log^{2}(N-k),$ (4.30)
$\displaystyle H_{3}(X)$ $\displaystyle=\sum_{1\leq k\leq X}\tau(k)c_{q}(k),$
(4.31) $\displaystyle H_{4}(N)$ $\displaystyle=\sum_{1\leq k\leq
N-1}\tau(k)c_{q}(k)\log(N-k),$ (4.32) $\displaystyle H_{5}(N)$
$\displaystyle=\sum_{1\leq k\leq N-1}\tau(k)c_{q}(k)\log^{2}(N-k),$ (4.33)
$\displaystyle H_{6}(N)$ $\displaystyle=\sum_{1\leq k\leq
N-1}k\tau(k)\log(N-k),$ (4.34) $\displaystyle H_{7}(N)$
$\displaystyle=\sum_{1\leq k\leq N-1}k\tau(k)\log^{2}(N-k),$ (4.35)
$\displaystyle H_{8}(X)$ $\displaystyle=\sum_{1\leq k\leq X}k\tau(k)c_{q}(k),$
(4.36) $\displaystyle H_{9}(N)$ $\displaystyle=\sum_{1\leq k\leq
N-1}k\tau(k)c_{q}(k)\log(N-k),$ (4.37) $\displaystyle H_{10}(N)$
$\displaystyle=\sum_{1\leq k\leq N-1}k\tau(k)c_{q}(k)\log^{2}(N-k).$

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

(4.39) $\displaystyle H_{1}(N)=\int_{1}^{N-1}\frac{t}{N-t}\log
tdt+(2\gamma-1)\int_{1}^{N-1}\frac{t}{N-t}dt+O(N^{1/2}\log N).$

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

(4.40) $N\left(\log^{2}N-\log N-\frac{\pi^{2}}{6}+1\right)+(2\gamma-1)(N\log
N-N)+O(N^{1/2}\log N).$

Thus,

(4.41) $H_{1}(N)=N\log^{2}N+(2\gamma-2)N\log
N+\left(\frac{\pi^{2}}{6}-2\gamma\right)N+O(N^{1/2}\log N).$

Similar, by both parts of Lemma 3.14, we get

(4.42) $\displaystyle H_{2}(N)$
$\displaystyle=\int_{1}^{N-1}\frac{1}{N-t}\left(t\log^{2}t+(2\gamma-2)t\log
t+\left(\frac{\pi^{2}}{6}-2\gamma\right)t+O(t^{1/2}\log t)\right)dt$ (4.43)
$\displaystyle=N\log^{3}N+(2\gamma-4)N\log^{2}N+\left(4-4\gamma-\frac{\pi^{2}}{6}\right)N\log
N$ (4.44)
$\displaystyle+\left(2\zeta(3)-2-(2\gamma-2)\left(\frac{\pi^{2}}{6}-1\right)-\frac{\pi^{2}}{6}+2\gamma\right)N+O\left(N^{1/2}\log^{2}N\right).$

We now estimate $H_{3}(X)$. We have, by definition of the Ramanujan sums,

(4.45) $H_{3}(X)=\sum_{\begin{subarray}{c}1\leq a\leq q\\\
(a,q)=1\end{subarray}}\sum_{1\leq k\leq X}\tau(k)e_{q}(ak).$

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,

(4.46) $H_{3}(X)=\frac{\varphi(q)}{q}X\left(\log X-2\log
q+2\gamma-1\right)+O\left((q^{3}X)^{\frac{1}{2}+\varepsilon}+q^{2+\varepsilon}\right).$

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

(4.47) $H_{4}(N)=NP_{2}(\log
N)+O\left((q^{3}N)^{\frac{1}{2}+\varepsilon}+q^{2+\varepsilon}\right).$

and

(4.48) $H_{5}(N)=NP_{3}(\log
N)+O\left((q^{3}N)^{\frac{1}{2}+\varepsilon}+q^{2+\varepsilon}\right),$

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

######  LEMMA 4.1.

(4.49) $\displaystyle H_{6}(N)$
$\displaystyle=\frac{1}{2}(N-1)^{2}\log^{2}(N-1)+\lambda_{1}(N-1)^{2}\log(N-1)+\lambda_{2}(N-1)^{2}+O(N^{3/2}\log
N),$ (4.50) $\displaystyle H_{7}(N)$
$\displaystyle=\frac{1}{2}(N-1)^{2}\log^{3}(N-1)+\lambda_{3}(N-1)^{2}\log^{2}(N-1)+\lambda_{4}(N-1)^{2}\log(N-1)$
(4.51) $\displaystyle+\lambda_{5}(N-1)^{2}+O(N^{3/2}\log^{3}N),$ (4.52)
$\displaystyle H_{8}(N)$ $\displaystyle=N^{2}Q_{1}(\log
N)+O\left((q^{3}N^{2})^{\frac{1}{2}+\varepsilon}+Nq^{2+\varepsilon}\right),$
(4.53) $\displaystyle H_{9}(N)$ $\displaystyle=N^{2}Q_{2}(\log
N)+O\left((q^{3}N^{2})^{\frac{1}{2}+\varepsilon}+Nq^{2+\varepsilon}\right),$
(4.54) $\displaystyle H_{10}(N)$ $\displaystyle=N^{2}Q_{3}(\log
N)+O\left((q^{3}N^{2})^{\frac{1}{2}+\varepsilon}+Nq^{2+\varepsilon}\right),$

with numerical constants $\lambda_{j}$’s and some explicit polynomials
$Q_{1},Q_{2}$, and $Q_{3}$ of degrees one, two, and three, respectively.

Here we have

(4.55) $\displaystyle\lambda_{1}$ $\displaystyle=\gamma-1/2,$ (4.56)
$\displaystyle\lambda_{2}$
$\displaystyle=\frac{\pi^{2}}{12}-\frac{1}{2}\gamma-\frac{3}{4},$ (4.57)
$\displaystyle\lambda_{3}$ $\displaystyle=\gamma-5/4,$

etc.

Collecting the $w_{j}$’s, $T_{j}$’s ,and the $H_{j}$’s above, we deduce the
following

######  LEMMA 4.2.

There is an explicit polynomial $P_{5}(\log N)$ of degree 5 in $\log N$ such
that

(4.58) $Q_{11}(N)=N^{2}P_{5}(\log
X)+O\left(N^{\frac{61}{38}+\varepsilon}\right).$

Consequently, from (4.12), (4.14), (4.15), and (4.26), we obtain that

(4.59) $Q_{1}(N)=N^{2}P_{8}(\log N)+O(N^{599/300}).$

With more effort, though tedious in details, one can calculate similar
asymptotic expansions for $Q_{2}(N)$ to $Q_{10}(N)$ in (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^{8}N$. Indeed, by (3.16) and
orthogonality of the Ramanujan sum $c_{q}(b)$, we have that

(4.60) $Q_{2}(N),\cdots,Q_{10}(N)\ll N^{2}\log^{6}N.$

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

(4.61) $\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\tilde{A}(\ell,b)^{2}=\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\ell^{-2}\ll\log N.$

Assume next $q_{1},q_{2}>1$. Suppose $(q_{1},q_{2})=1$. Then

(4.62) $\sum_{1\leq b\leq\ell}c_{q_{1}}(b)c_{q_{2}}(b)=\sum_{1\leq
b\leq\ell}c_{q_{1}q_{2}}(b)\ll q_{1}q_{2}.$

From this and (3.16), we get

(4.63) $\displaystyle\sum_{1\leq b\leq\ell}\tilde{A}^{2}(\ell,b)$
$\displaystyle=\ell^{-2}\sum_{q_{1}\mid\ell}\sum_{q_{2}\mid\ell}q_{1}^{-1}q_{2}^{-1}\sum_{1\leq
b\leq\ell}c_{q_{1}}(b)c_{q_{2}}(b)\log^{2}q_{1}\log^{2}q_{2}$ (4.64)
$\displaystyle=\ell^{-2}\sum_{q_{1}\mid\ell}\log^{2}q_{1}\sum_{q_{2}\mid\ell}\log^{2}q_{2}\ll\ell^{-2}\log^{4}\ell$

and, hence,

(4.65) $\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\tilde{A}(\ell,b)^{2}\ll\sum_{1\leq\ell\leq
N}\ell^{-2}\log^{4}\ell\ll\log N.$

It remains to consider the case where $(q_{1},q_{2})>1$. We have

(4.66) $\displaystyle\sum_{1\leq b\leq\ell}c_{q}(b)^{2}=\sum_{d_{1}\mid
q_{1}}\sum_{d_{2}\mid
q_{2}}d_{1}d_{2}\mu(q_{1}/d_{1})\mu(q_{2}/d_{2})\sum_{\begin{subarray}{c}1\leq
b\leq\ell\\\ d_{1}\mid b\\\ d_{2}\mid
b\end{subarray}}1\ll\ell(q_{1}q_{2})^{\varepsilon}+(q_{1}q_{2}^{1+\varepsilon}).$

Thus,

(4.67) $\sum_{1\leq\ell\leq N}\sum_{1\leq
b\leq\ell}\tilde{A}^{2}(\ell,b)\ll\sum_{1\leq\ell\leq
N}\ell^{-1}\tau(\ell)\ll\log^{2}N$

This, together with (4.61) and (4.65), give that $Q_{2}(N)$ is at most
$O(N^{2}\log^{6}N)$, verifying (4.60) for $Q_{2}(N)$.

As mentioned before, the estimates in (4.60) 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

(4.68) $Q_{2}(N)+\cdots+Q_{10}(N)=N^{2}P_{6}(\log N)+O(N^{599/300}).$

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

(4.69) $N^{2}P_{8}(\log N)+O(N^{2-1/300}),$

which gives the right-hand side of (2.2). This completes the proof of the
theorem.

Acknowledgments. The author thanks Soundararajan for pointing out the
reference [11] 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.

## References

  * [1] S. Baier, T. D. Browning, G. Marasingha, L. Zhao, Averages of shifted convolutions of $d_{3}(n)$, Proceedings of the Edinburgh Mathematical Society, 55(3) (2012), 551-576. doi:10.1017/S001309151100037X
  * [2] M. B. Barban, Analogues of the divisor problem of Titchmarch (in Russian), Vestnik Leningrad Univ. Ser. Ma. Meh. Astronom. 18 (4) (1963), pp. 5-13.
  * [3] M. B. Barban, On the average error in the generalized prime number theorem (in Russian), Dokl. Akad. Nauk USSR 5 (1964), pp. 5-7.
  * [4] E. Bombieri, On the large sieve, Mathematika 12 (1965), 201-225.  https://doi.org/10.1112/S0025579300005313
  * [5] J. B. Conrey and S. M. Gonek, High moments of the Riemann zeta-function, Duke Math. J. 107 (3) 577-604.  https://doi.org/10.1215/S0012-7094-01-10737-0
  * [6] J. B. Conrey and J. P. Keating, Moments of zeta and correlations of divisor-sums: I, Phil. Trans. R. Soc. A 373:20140313 (2015).  http://dx.doi.org/10.1098/rsta.2014.0313
  * [7] H. Davenport and H. Halberstam, Primes in arithmetic progressions, Michigan Math. J. 13 (1966), pp. 485-489.
  * [8] T. Estermann, On the representations of a number as the sum of two products, Proc. London Math. Soc. (2) 31 (1930), 123-133.
  * [9] P. X. Gallagher, The large sieve, Mathematika 14 (1967), pp. 14-20.
  * [10] D. Goldston, R. C. Vaughan, On the Montgomery-Hooley asymptotic formula, LONDON MATHEMATICAL SOCIETY LECTURE NOTE SERIES (1996): 117-142.
  * [11] A. J. Harper and K. Soundararajan, Lower bounds for the variance of sequences in arithmetic progressions: Primes and divisor functions, The Quarterly Journal of Mathematics, Volume 68, Issue 1, March 2017, pp. 97-123.
  * [12] C. Hooley, On the Barban-Davenport-Halberstam theorem. I, J. Reine Angew. Math., 274/275, pp. 206-223 (1975).
  * [13] A. Ivić, On the ternary additive divisor problem and the sixth moment of the zeta-function, in Sieve Methods, Exponential Sums, and Their Applications in Number Theory, Ed. by G. R. H. Greaves, G. Harman, and M. N. Huxley (Cambridge Univ. Press, Cambridge, 1997), pp. 1001-1039.
  * [14] A. F. Lavrik, Binary problems of additive number theory connected with the method of trigonometric sums of I. M. Vinogradov, Vestnik Leningrad. Univ. 16 13 (1961), pp. 11-27.
  * [15] H. L. Montgomery, Primes in arithmetic progressions, Michigan Math. J. 17, pp. 33-39 (1970).
  * [16] Y. Motohashi, An asymptotic formula in the theory of numbers,  Acta Arith. 17 (1970), pp. 255-264.
  * [17] Y. Motohashi, On the distribution of the divisor function in arithmetic progressions, Acta Arithetica XXII (1973), pp. 175-199.
  * [18] M. R. Murty, Problems in Analytic Number Theory, Graduate Texts in Mathematics (Book 206), Springer; 2nd edition (2007).  https://doi.org/10.1007/978-1-4757-3441-6
  * [19] D. T. Nguyen, Generalized divisor functions in arithmetic progressions: I,  J. Number Theory 227 (2021), pp. 30-93.  https://doi.org/10.1016/j.jnt.2021.03.021
  * [20] D. T. Nguyen, Variance of the k-fold divisor function in arithmetic progressions for individual modulus, preprint arXiv:2205.02354 [math.NT] (2022).
  * [21] T. Parry, A Montgomery-Hooley theorem for the k-fold divisor function, preprint arXiv:2302.11045v1 [math.NT] (2023).
  * [22] B. Rodgers and K. Soundararajan, The variance of divisor sums in arithmetic progressions, Forum Math. 30 (2018), no. 2, 269-293.  https://doi.org/10.1515/forum-2016-0227
  * [23] R. A. Smith, The generalized divisor problem over arithmetic progressions, Math. Ann. 260, 255-268 (1982).  https://doi.org/10.1155/IMRN.2005.1
  * [24] A. I. Vinogradov, The density Hypothesis for Dirichlet L-series, Izv. Akad. Nauk SSSR Ser. Mat. 29 (1965), 903-934.  MR0194397
  * [25] Y.T. Zhang, Bounded gaps between primes, Ann. of Math. 179 (2014), no. 3, 1121-1174.  http://doi.org/10.4007/annals.2014.179.3.7