# A Montgomery-Hooley theorem for the $k$-fold divisor function

Tomos Parry

###### Abstract

Let $d_{k}(n)$ denote the $k$-fold divisor function. For a wide range of large
$q$ the expected bound

$\sum_{n\leq x\atop{n\equiv a(q)}}d_{k}(n)-\text{ main term
}\approx\sqrt{\frac{x}{q}}$

is shown to be true in an average sense - for all $k$. This generalises the
work of Pongsriiam and Vaughan [15] who studied $k=2$, and answers the work of
Rodgers and Soundararajan [17], who used the asymptotic large sieve to study a
smoothed version of the problem. We use a circle method approach as developed
by Goldston and Vaughan [7] to study the unsmoothed problem.

##  1 \- Introduction

For $k\geq 1$ define the $k$-fold divisor function

$d_{k}(n)=\sum_{u_{1}\cdot\cdot\cdot u_{k}=n\atop
u_{1},...,u_{k}\in\mathbb{N}}1.$

The question of the distribution of values of $d_{k}(n)$ has a rich history,
the values being linked to the Riemann zeta function through

$\zeta(s)^{k}=\sum_{n=1}^{\infty}\frac{d_{k}(n)}{n^{s}}.$

So too does the question of their distribution in arithmetic progressions,
being in turn linked to Dirichlet $L$-functions and to, in particular, moments
of Dirichlet $L$-functions, as indeed is said, for example, on page 3 of [17].
Consequently larger $k$ often poses the more problems. The driving question
seems to have been _the divisor problem for arithmetic progressions_ , which
asks when do we have a formula

$\displaystyle\sum_{n\leq x\atop{n\equiv
a(q)}}d_{k}(n)\approx\frac{xf_{x}(q,a)}{q}$ (1)

or in other words when are the values of $d_{k}(n)$ uniformly distributed
across the residue classes; here $f_{x}(q,a)$ is the residue at $s=1$ of
something that looks like $\zeta(s)^{k}x^{s-1}/s$ and which we can think of
therefore as having size no bigger than $(\log x)^{k-1}$. If (1) holds for all
$q$ up to essentially $x^{\theta}$ then $d_{k}(n)$ is said to have _exponent
of distribution $\theta$_. A critical value is $\theta=1/2$ which has direct
consequences for the prime numbers - see Theorem 4 of [5] or, of course,
consider the breakthrough ideas of Zhang on bounded gaps. For $k=2$ it is by
now a classical result of Selberg and of Hooley that $\theta=2/3$ is valid but
further improvements have proven themselves elusive. For $k=3$ important
power-improvements on $\theta=1/2$ were made in the 80s by Friedlander and
Iwaniec and for $k=4$ we have no better than $\theta=1/2$ from the 60s due to
Linnik - see pages 32-33 of [13] for references to these results. For larger
$k$ it is not known whether $\theta\geq 1/2$.

So as is usual in these circles of questions one is inclined to ask instead
what happens if we average - either by considering the variance

$V_{x}(q):=\sum_{a=1}^{q}\left|\sum_{n\leq x\atop{n\equiv
a(q)}}d_{k}(n)-\frac{xf_{x}(q,a)}{q}\right|^{2}$

or the averaged variance

$V(x,Q):=\sum_{q\leq Q}V_{x}(q)$

the point being that asymptotics for these of sizes around $x$ and $xQ$
respectively would confirm an error around $\sqrt{x/q}$ on average. Starting
with a result of Motohashi in the 70s there was a line of work (of which we
mention [1], [2], [14]) on these variances culminating in 2012 with a very
satisfactory result of Lau and Zhao [9] which provided an asymptotic for
$V_{x}(q)$ in a range essentially $\sqrt{x}\leq q\leq x$. For $k>2$ however,
an asymptotic formula for either variance isn’t known, and in [17] Rodgers and
Soundararajan put forward conjectures as to the true sizes of these variances
for general $k$, these based on comparison with the function field case,
investigated in [8]. They then go on to provide evidence for these conjectures
by approaching the problem with smooth weights. Allowing smooth weights
usually simplifies things (consider the usual Dirichlet divisor problem, where
improvements on an error $\ll x^{1/3}$ are considered deep whilst with
smoothing an error $\ll 1$ is straightfoward) and indeed they achieve for
general $k$ an asymptotic formula for smooth $V(x,Q)$ in a range essentially
$Q\geq x^{k/(k+2)}$. More recently still, Nguyen [12] has found an asymptotic
formula even for smooth $V_{x}(q)$ in a range essentially $x^{1/(k-1)}\leq
q\leq x^{1/k}$. A step in a different direction is to change the approximating
main term to a more workable but less natural or probabilistic one - for an
asymptotic formula in this case see [3].

But as the authors in [17] allude to themselves, it is another challenge to
prove such results with sharp cut-offs, their concern in the paper being
confirming the nature of the main term in the integer case at all. But very
recently progress has been done even in the sharp cut-off case, with Nguyen
[13] finding an asymptotic formula for $V(x,x)$ in the case $k=3$. In this
article, we take things further by providing one for $V(x,Q)$ for all $k$.

Let’s state our theorem. In Lemma 1 (C) we will prove that there is a quantity
$f_{x}(q,a)$ such that for fixed $q,a\in\mathbb{N}$

$\sum_{n\leq x\atop{n\equiv a(q)}}d_{k}(n)\sim\frac{xf_{x}(q,a)}{q}\hskip
28.45274ptx\rightarrow\infty.$ (2)

(For a precise definition see that lemma, but essentially $f_{x}(q,a)$ is a
degree $\leq k-1$ polynomial in $\log x$ with coefficients
$\ll_{\epsilon}q^{\epsilon}$). Suppose we know that for some
$\mathfrak{c}\in(1/2,1)$ we have

$\int_{\pm\infty}\frac{\max_{0\leq n\leq
2k-2}|\zeta^{(n)}(\sigma+it)|^{k(k-2)}dt}{(1+|t|)^{3/2+\mathfrak{c}}}\ll
1\hskip 28.45274pt\text{for }\sigma\geq\mathfrak{c}.$

A bound essentially $\zeta(s)\ll t^{(1-\sigma)/2}$ is classical, and therefore
from Cauchy’s integral formula so is one $\zeta^{(n)}(s)^{k}\ll
t^{k(1-\sigma)/2}$, so we can certainly take $\mathfrak{c}\in(1-1/k(k-2),1)$
for $k>2$ or take $\mathfrak{c}\in(1/2,1)$ for $k=2$. Let
$\mathfrak{d}\in(0,1)$ be any value for which we know

$\sum_{n\leq x}d_{k}(n)^{2}=xP(\log
x)+\mathcal{O}_{\epsilon}\left(x^{1-\mathfrak{d}+\epsilon}\right)$ (3)

for some polynomial $P$ of degree $k^{2}-1$. By page 12 of [17] we have for
$\sigma>1$

$\sum_{n=1}^{\infty}\frac{d_{k}(n)^{2}}{n^{s}}=\zeta(s)^{k^{2}}f(s)$

where $f$ for $\sigma\geq 1/2+\epsilon$ is holomorphic and $\ll_{\epsilon}1$,
so a Perron’s formula argument shows $\mathfrak{d}=2/(k^{2}+4)$ to be
permissable for general $k$ whilst a classical result of Wilson and Ramanujan
says $\mathfrak{d}=1/2$ is okay for $k=2$.

Then our conclusion is

######  Theorem 1.

Let $f_{x}(q,a)$ be as in (2) and define

$\displaystyle E_{x}(q,a)=\sum_{n\leq x\atop{n\equiv
a(q)}}d_{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}.$

Then there is a polynomial $P(\cdot,\cdot)$ of degree $\leq k^{2}-1$ such that
for $1\leq Q=o(x)$

$\displaystyle V(x,Q)=xQP(\log x,\log
Q)+\mathcal{O}_{k,\epsilon}\left(Q^{2}\left(\frac{x}{Q}\right)^{\mathfrak{c}}+\underbrace{x^{3/2+\epsilon}}_{k=2}+\underbrace{x^{2-4/(6k-3)+\epsilon}}_{k>2}+Qx^{1-\mathfrak{d}+\epsilon}\right).$

We consider the main feature of our theorem to be its validity for general
$k$.

With some work the polynomial could be explicitly worked out of course. We
note that we have chosen to average over a complete residue set, and not over
a reduced one, as in most of the works referenced above, in agreement with a
remark of Motohashi on page 178 of [11].

The study of the mean-square of a function averaging over both residue and
modulus started in the 60s with the Barban-Davenport-Halberstam Theorem, which
provided an upper bound of the right size for the variance of the primes. This
was refined to an asymptotic formula by Montgomery and by Hooley and
correspondingly results of our kind are sometimes referred to as Montgomery-
Hooley theorems - see [19] for a survey. In [7] Goldston and Vaughan developed
a circle method approach to establishing Montgomery-Hooley theorems and it is
that which we follow here.

Sequences or functions for which there exist Montgomery-Hooley theorems seem
to have so far been mostly assumed to satisfy

$\sum_{n\leq x\atop{n\equiv a(q)}}F(n)\approx\frac{xf(q,a)}{q}$ (4)

although recently thinner sequences have also been investigated - see [4]. The
divisor function poses a different problem in that, as said on page 86 of
[19], the RHS of (1) doesn’t factorise in the simple way of (4). With this
paper we are showing that the method of Goldston and Vaughan still succeeds.

Finally we remark that as far as only upper bounds are concerned results will
already be known even for $d_{k}(n)$, even if nothing explicit is stated in
the literature - a general principle is that, through the large sieve, a
Siegel-Walfisz theorem gives a result for the variance. So just for the record
we also formulate

######  Theorem 2.

Let $V(x,Q)$ be as in Theorem 1. For $1\leq Q\leq x$

$V(x,Q)\ll_{\epsilon}x^{\epsilon}\left(xQ+\underbrace{x^{2-1/k}}_{k>2}\right).$

and prove it following Lemma 2. The proof of Theorem 1 starts on page 15.

##  2 \- Lemmas

We start with simple estimates for the $k$-fold divisor function’s exponential
sum and counts in arithmetic progressions. We make use of a result of [15] but
otherwise our estimates are very simple - we are interested only in any power-
savings. In particular any improvements here would also work their way through
to our theorems.

######  Lemma 1.

Let $k,q,a,d\in\mathbb{N}$ with $k\geq 2$ and $d|q$ and let $X\geq 1$. All
error terms below are
$\mathcal{O}_{k,\epsilon}((qX)^{\epsilon}\cdot\cdot\hskip 2.84526pt\cdot)$ and
we write

$\theta=2/(k+1)\hskip 19.91692pt\Delta=1/(k-1)\hskip
19.91692pt\delta=2/(2k-1).$

Then

$\displaystyle(A)\hskip 65.44133pt\sum_{n\leq
X\atop{(n,q)=d}}\frac{d_{k}(n)}{n}$ $\displaystyle\hskip 2.84526pt=\hskip
2.84526pt$ $\displaystyle
Res_{s=0}\Bigg{\\{}\frac{X^{s}}{s}\sum_{n=1\atop{(n,q)=d}}^{\infty}\frac{d_{k}(n)}{n^{s+1}}\Bigg{\\}}+\mathcal{O}\left(\frac{1}{X}\left(\frac{X}{d}\right)^{1-\theta}\right)$
$\displaystyle(B)\hskip 42.67912pt\sum_{n\leq
X}d_{k}(n)e\left(\frac{na}{q}\right)$ $\displaystyle\hskip 2.84526pt=\hskip
2.84526pt$
$\displaystyle\frac{X\mathcal{M}_{X}\left(q/(q,a)\right)}{q/(q,a)}+\mathcal{O}\left(X\left(\left(\frac{q}{X}\right)^{\Delta}+\frac{1}{\sqrt{q}}\left(\frac{q}{X}\right)^{\Delta/2}\right)\right)$

where

$\displaystyle\mathcal{M}_{X}(q)$ $\displaystyle=$ $\displaystyle P(X,q)\hskip
14.22636pt\text{for }k=2$ $\displaystyle\mathcal{M}_{X}(q)$ $\displaystyle=$
$\displaystyle\sum_{r_{1}|\cdot\cdot\cdot|r_{k-2}|q\atop{h_{1}|r_{1},...,h_{k-2}|r_{k-2}}}\frac{\mu(h_{1})\cdot\cdot\cdot\mu(h_{k-2})P(X,q,\mathbf{r},\mathbf{h})}{h_{1}\cdot\cdot\cdot
h_{k-2}}\hskip 14.22636pt\text{for }k>2$

for some polynomials $P(\cdot,...,\cdot)$ in $\log(\cdot),...,\log(\cdot)$ of
degree $\leq k-1$.

Let $\mathcal{M}_{X}(q)$ be as in claim (B), write

$c_{q}(n)=\sum_{d|q,n}\mu(q/d)d=\sum_{a=1\atop{(a,q)=1}}^{q}e\left(\frac{an}{q}\right)\hskip
19.91692pt\text{for Ramanujan's sum, and let}\hskip
19.91692ptf_{X}(q,a)=\sum_{d|q}\frac{c_{d}(a)\mathcal{M}_{X}(d)}{d}.$

Then

$\displaystyle(C)\hskip 71.13188pt\sum_{n\leq X\atop{n\equiv a(q)}}d_{k}(n)$
$\displaystyle\hskip 2.84526pt=\hskip 2.84526pt$
$\displaystyle\frac{Xf_{X}(q,a)}{q}+\mathcal{O}\left(X\left(\left(\frac{\sqrt{q}}{X}\right)^{\Delta}+\frac{1}{X^{\delta}}\right)\right)$
$\displaystyle(D)\hskip 54.06023pt\sum_{n\leq X}d_{k}(n)c_{q}(n)$
$\displaystyle\hskip 2.84526pt=\hskip 2.84526pt$
$\displaystyle\frac{X\phi(q)\mathcal{M}_{X}(q)}{q}+\mathcal{O}\left(X^{1-\theta}q^{\theta}\right).$

###### Proof.

Throughout we drop $X^{\epsilon},q^{\epsilon}$ factors from error terms, write
$c=1/\log(2X)$, write $T$ for any parameter $1\leq T\ll X$, write
$\Sigma_{\chi(q)}$ for a sum over the Dirichlet characters of modulus $q$ and
write $L_{\chi}(s)$ for the Dirichlet $L$-function of a character $\chi$.
Before we address the individual claims of the lemma let us do some
preparatory work in establishing (6) and (9)-(12) below. For $j\in\mathbb{N}$
write $P_{j}(\cdot,...,\cdot)$ to mean simply any polynomial in
$\log(\cdot),...,\log(\cdot)$ of degree $\leq j$ and for any vector
$\mathbf{v}$ write $\mathcal{N}_{\mathbf{v}}^{k}(q,d)$ for any quantity of the
form

$\sum_{r_{k}h_{k}|q\atop{...\atop{r_{1}\cdot\cdot\cdot
r_{k}h_{k}|q\atop{r_{1}\cdot\cdot\cdot
r_{k}|d\atop{H|q/d}}}}}\frac{\mu(h_{1})\cdot\cdot\cdot\mu(h_{k})\mu(H)P_{k+1}(\mathbf{v},q,d,\mathbf{r},\mathbf{h},H)}{h_{1}\cdot\cdot\cdot
h_{k}H}$

and write $\mathcal{N}_{\mathbf{v}}^{0}(q,d)$ for one of the form

$\sum_{H|q/d}\frac{\mu(H)P_{1}(\mathbf{v},q,d,H)}{H}.$

It is straightforward to establish

$\sum_{n=1\atop{(n,q)=d}}^{\infty}\frac{d_{2}(n)}{n^{s}}=\frac{\zeta(s)^{2}}{d^{s}}\sum_{rh|q\atop{r|d\atop{H|q/d}}}\frac{\mu(h)\mu(H)}{(hH)^{s}}$

and then induction shows

$\sum_{n=1\atop{(n,q)=d}}^{\infty}\frac{d_{k}(n)}{n^{s}}=\frac{\zeta(s)^{k}}{d^{s}}\sum_{r_{k}h_{k}|q\atop{\cdot\cdot\cdot\atop{r_{1}\cdot\cdot\cdot
r_{k-1}h_{k-1}|q\atop{r_{1}\cdot\cdot\cdot
r_{k-1}|d\atop{H|q/d}}}}}\frac{\mu(h_{1})\cdot\cdot\cdot\mu(h_{k-1})\mu(H)}{(h_{1}\cdot\cdot\cdot
h_{k-1}H)^{s}}$

so

$Res_{s=1}\Bigg{\\{}\frac{X^{s-1}}{s}\sum_{n=1\atop{(n,q)=d}}^{\infty}\frac{d_{k}(n)}{n^{s}}\Bigg{\\}}\hskip
14.22636pt\text{ is a polynomial in $\log X$ of degree $\leq k-1$}$ (5)

and

$\displaystyle
Res_{s=0}\Bigg{\\{}\frac{X^{s}}{s}\sum_{n=1\atop{(n,q)=d}}^{\infty}\frac{d_{k}(n)}{n^{s+1}}\Bigg{\\}}=\frac{\mathcal{N}_{X}^{k-1}(q,d)}{d}.\hskip
28.45274pt$ (6)

Orthogonality and Perron’s formula says that for $(q,a)=1$

$\displaystyle\sum_{n\leq X\atop{n\equiv a(q)}}d_{k}(n)$ $\displaystyle=$
$\displaystyle\frac{1}{\phi(q)}\sum_{\chi(q)}\overline{\chi}(a)\int_{1+c\pm
iT}\frac{L_{\chi}(s)^{k}X^{s}ds}{s}+\mathcal{O}\left(\frac{X}{T}\right)$

so, using the well-known bound $L_{\chi}(s)\ll_{q}t^{(1-\sigma)/2}$ to move
the integral to the left at the cost of errors

$\displaystyle\left(\int_{\epsilon\pm
iT}+\int_{\epsilon+iT}^{c+iT}\right)\frac{L_{\chi}(s)^{k}X^{s}ds}{s}$
$\displaystyle\ll_{q}$ $\displaystyle T^{k/2}+\frac{X}{T}\ll X^{1-2/(k+2)}$

and picking up a residue we may say

$\displaystyle\text{for }(q,a)=1\hskip 28.45274pt\sum_{n\leq X\atop{n\equiv
a(q)}}d_{k}(n)$ $\displaystyle=$
$\displaystyle\frac{X}{\phi(q)}Res_{s=1}\Bigg{\\{}\frac{L_{\chi_{0}}(s)^{k}X^{s-1}}{s}\Bigg{\\}}+\mathcal{O}_{q}\left(X^{1-2/(k+2)}\right).\hskip
28.45274pt$ (7)

To remove the coprimality condition we use an argument from [6]. Define
Popovici’s function $\mu^{k}=\mu\star\cdot\cdot\cdot\star\mu$ with $k$
convolution factors and let $\delta$ be a power of a prime $p$. We have
$N>k\implies\mu^{k}(p^{N})=0$ and $N\geq
2\implies(d_{2}(\delta\cdot)\star\mu^{2})(p^{N})=0$. Define
$c_{\delta}=d_{k+1}(\delta/p)$ so that on prime powers
$d_{k+1}(\delta\cdot)=d_{k}(\delta\cdot)\star 1+c_{\delta}1$ and therefore
$d_{k+1}(\delta\cdot)\star\mu^{k+1}=d_{k}(\delta\cdot)\star\mu^{k}+c_{\delta}\mu^{k}$
so with the last sentence

$N\geq k\implies(d_{k}(p^{D}\cdot)\star\mu^{k})(p^{N})=0$ (8)

holds for all $k\in\mathbb{N}$, all primes $p$, and all $N,D\geq 1$. For
$\delta\in\mathbb{N}$ define $F_{\delta}=d_{k}(\delta\cdot)\star\mu^{k}$ which
is multiplicative in the sense that if $D_{i},N_{i}$ are non-negative powers
of primes $p_{i}$ then

$F_{D_{1}\cdot\cdot\cdot D_{r}}(N_{1}\cdot\cdot\cdot
N_{r})=F_{D_{1}}(N_{1})\cdot\cdot\cdot F_{D_{r}}(N_{r})$

so (8) says $F_{\delta}(n)=0$ unless $n|\delta^{k-1}$, and therefore

$\sum_{n}d_{k}(\delta
n)=\sum_{n,m\atop{m|\delta^{k-1}}}F_{\delta}(m)d_{k}(n)\hskip 14.22636pt\text{
and }\hskip
14.22636pt\sum_{m>X}\frac{F_{\delta}(m)}{m}\ll\frac{\delta^{\epsilon}}{X}.$

Consequently if for coprime $q,a\in\mathbb{N}$ and $Q\in\mathbb{N}$ with
$(Q,q)=1$ we have for some $0\leq w,E\leq 1$

$\sum_{n\leq X\atop{n\equiv
a(q)\atop{(n,Q)=1}}}\frac{d_{k}(n)}{n^{w}}=\frac{1}{\phi(q)}Res_{s=1-w}\Bigg{\\{}\frac{X^{s}}{s}\sum_{n=1\atop{(n,qQ)=1}}^{\infty}\frac{d_{k}(n)}{n^{s+w}}\Bigg{\\}}+\mathcal{O}\left(X^{1-w-E}\right)$

then for general $q,a,Q,D\in\mathbb{N}$ with $D|Q$ and $(Q,q)=1$ we have,
writing $\delta=(q,a)\hskip 5.69054ptq=\delta Dq^{\prime}\hskip
5.69054pta=\delta Da^{\prime}$,

$\displaystyle\sum_{n\leq X\atop{n\equiv
a(q)\atop{(n,Q)=D}}}\frac{d_{k}(n)}{n^{w}}$ $\displaystyle=$
$\displaystyle\frac{1}{(\delta D)^{w}}\sum_{m\leq X/\delta D\atop{m|(\delta
D)^{k-1}}}\frac{F_{\delta D}(m)}{m^{w}}\sum_{n\leq X/m\delta D\atop{nmD\equiv
a^{\prime}(q^{\prime})\atop{(nm\delta,Q/D)=1}}}\frac{d_{k}(n)}{n^{w}}$ (9)
$\displaystyle=$ $\displaystyle\frac{1}{(\delta
D)^{w}\phi(q^{\prime})}\sum_{m\leq X/\delta D\atop{m|(\delta
D)^{k-1}}}\frac{F_{\delta D}(m)}{m^{w}}Res_{s=1-w}\Bigg{\\{}\frac{(X/m\delta
D)^{s}}{s}\sum_{n=1\atop{(nmD,q^{\prime})=1\atop{(nm\delta,Q/D)=1}}}^{\infty}\frac{d_{k}(n)}{n^{s+w}}\Bigg{\\}}$
$\displaystyle\hskip 128.0374pt+\hskip
11.38109pt\mathcal{O}\left(\frac{1}{(\delta D)^{w}}\left(\frac{X}{\delta
D}\right)^{1-w-E}\right)$ $\displaystyle=$
$\displaystyle\frac{1}{\phi(q^{\prime})}Res_{s={1-w}}\Bigg{\\{}\frac{X^{s}}{s}\sum_{n=1\atop{(n,q)=\delta\atop{(n,Q)=D}}}^{\infty}\frac{d_{k}(n)}{n^{s+w}}\Bigg{\\}}+\mathcal{O}\left(\frac{1}{(\delta
D)^{w}}\left(\frac{X}{\delta D}\right)^{1-w-E}+\frac{1}{X^{w}}\right).$

In particular (7) and (5) give

$\displaystyle\sum_{n\leq X\atop{n\equiv
a(q)}}d_{k}(n)=X\cdot\underbrace{\frac{1}{\phi\left(q^{\prime}\right)}Res_{s=1}\Bigg{\\{}\frac{X^{s-1}}{s}\sum_{n=1\atop{(n,q)=\delta}}^{\infty}\frac{d_{k}(n)}{n^{s}}\Bigg{\\}}}_{\text{polynomial
in $\log X$ of degree $\leq k-1$
}}+\mathcal{O}_{q}\left(X^{1-2/(k+2)}\right).\hskip 28.45274pt$ (10)

Finally the Euler-Maclaurin summation formula says that

$\displaystyle\sum_{v<X}\frac{P_{j}(v)}{v}=P_{j+1}(X)+\mathcal{O}\left(\frac{1}{X}\right)$

so for any $y>0$

$\displaystyle\sum_{v<X/y}\frac{1}{q/(q,v)}\left\\{\frac{X}{v}\mathcal{N}^{k-2}_{X/v}\left(\frac{q}{(q,v)},\frac{q}{(q,v)}\right)-y\mathcal{N}^{k-2}_{y}\left(\frac{q}{(q,v)},\frac{q}{(q,v)}\right)\right\\}=\frac{X\mathcal{N}^{k-1}_{X,y}(q,q)}{q}+\mathcal{O}(y)$
(11)

and

$\displaystyle\sum_{v<X/y\atop{(v,q)=1}}\left\\{\frac{X}{v}\mathcal{N}^{k-1,k-1}_{X/v}\left(q,1\right)-y\mathcal{N}^{k-1,k-1}_{y}\left(q,1\right)\right\\}=X\mathcal{N}^{k,k}_{X,y}(q,1)+\mathcal{O}(y)\hskip
28.45274pt$ (12)

and now we are ready to turn to the individual claims. (A) Let
$Q\in\mathbb{N}$. Perron’s formula says that

$\displaystyle\sum_{n\leq X\atop{(n,Q)=1}}\frac{d_{k}(n)}{n}$ $\displaystyle=$
$\displaystyle\int_{c\pm
iT}\frac{L_{\chi_{0}}(s+1)^{k}X^{s}ds}{s}+\mathcal{O}\left(\frac{1}{T}\right).$
(13)

Arguing as in Section 12.2 of [18] it may be shown that

$\displaystyle\int_{-1-\epsilon\pm
iT}\frac{L_{\chi_{0}}(s+1)^{k}X^{it}ds}{s}\ll T^{k/2-1/2}\hskip
28.45274pt\text{whilst easily}\hskip
28.45274pt\int_{-1-\epsilon+iT}^{c+iT}|L_{\chi_{0}}(s+1)|^{k}X^{\sigma}ds\ll\frac{T^{k/2}}{X}+1$

so moving the integral in (13) to the left we pick up a residue and introduce
errors

$\displaystyle\ll\frac{T^{k/2-1/2}}{X}+\frac{1}{T}\ll X^{-\theta}$

to conclude

$\displaystyle\sum_{n\leq
X\atop{(n,Q)=1}}\frac{d_{k}(n)}{n}=Res_{s=0}\Bigg{\\{}\frac{X^{s}}{s}\sum_{n=1\atop{(n,Q)=1}}^{\infty}\frac{d_{k}(n)}{n^{s+1}}\Bigg{\\}}+\mathcal{O}\left(X^{-\theta}\right).$

From this, the sentence containing (9), and (6) we’re done. (B) Assume
$(a,q)=1$ and $q\ll X$. The claim in question is true for $k=2$ by Lemma 3.2
of [14] so let’s suppose it’s true for some $k\geq 2$ and aim to show the
claim for $k+1$; this means we want a main term of the form
$\mathcal{N}_{X}^{k-1}(q,q)$. Write $D^{k}_{a/q}(X)$ for the sum in question
so that for a parameter $0<y\leq X$ we have

$\displaystyle D^{k+1}_{a/q}(X)$ $\displaystyle=$ $\displaystyle\sum_{u\leq
y}d_{k}(u)\sum_{v\leq
X/u}e\left(\frac{uva}{q}\right)+\sum_{v<X/y}\Big{(}D_{va/q}^{k}(X/v)-D_{va/q}^{k}(y)\Big{)}.\hskip
28.45274pt$ (14)

As

$\displaystyle\sum_{u\leq y\atop{q\nmid u}}d_{k}(u)\sum_{v\leq
x/u}e\left(\frac{uva}{q}\right)\ll y+q$

the first sum in (14) is from part (A) and then (6)

$\displaystyle\frac{X\mathcal{N}_{y}^{k-1}(q,q)}{q}+\mathcal{O}\left(\frac{Xq^{\theta-1}}{y^{\theta}}+y+q\right)$

whilst by assumption and then (11) the second is

$\displaystyle\frac{X}{q}\mathcal{N}_{X,y}^{k-1}(q,q)+\mathcal{O}\left(y+X\left(\frac{q}{y}\right)^{\Delta}+\frac{X}{\sqrt{q}}\left(\frac{q}{y}\right)^{\Delta/2}\right).$

Choosing $y=q\left(X/q\right)^{1/(1+\Delta)}$ gives a main term of the
appropriate form and an error term

$\ll
X\left(\frac{q}{X}\right)^{\Delta/(1+\Delta)}+\frac{X}{\sqrt{q}}\left(\frac{q}{X}\right)^{\Delta/2(1+\Delta)}$

(it perhaps helping to note $\Delta/2\leq\theta$) and we have the claim for
$k+1$. (C) Write $\delta=(q,a)$ and $q=q^{\prime}\delta$. From part (B) the
sum in question is

$\displaystyle\frac{1}{q}\sum_{h|q}\sideset{}{{}^{\prime}}{\sum}_{b=1}^{h}e\left(-\frac{ab}{h}\right)\sum_{n\leq
X}d_{k}(n)e\left(\frac{nb}{h}\right)=\frac{X}{q}\sum_{h|q}\frac{c_{h}(a)\mathcal{M}_{X}(h)}{h}+\mathcal{O}_{q}\left(X^{1-\Delta/2}\right)$

and here the sum in the main term is a polynomial in $\log X$ of degree $\leq
k-1$ so comapring with (10) the main term must be

$\frac{X}{\phi(q^{\prime})}Res_{s=1}\Bigg{\\{}\frac{X^{s-1}}{s}\sum_{n=1\atop{(n,q)=\delta}}^{\infty}\frac{d_{k}(n)}{n^{s}}\Bigg{\\}}$

and therefore, from the sentence containing (9), we can assume $\delta=1$. As
$\mathcal{N}_{X}^{k-2}(q,1)/q$ is also a polynomial in $\log X$ of degree
$\leq k-1$, it is enough to prove the claim with main term
$X\mathcal{N}_{X}^{k-2}(q,1)/q$. For $k=2$ the claim holds by Theorem 1.1 of
[15] so we now suppose the claim is true for some $k\geq 2$ and show it also
holds for $k+1$. For a parameter $0<y\leq X$ we have

$\displaystyle\sum_{n\leq X\atop{n\equiv a(q)}}d_{k+1}(n)$ $\displaystyle=$
$\displaystyle\sum_{u\leq y\atop{(u,q)=1}}d_{k}(u)\sum_{v\leq X/u\atop{v\equiv
a\overline{u}(q)}}1+\sum_{v<X/y\atop{(v,q)=1}}\sum_{y<u\leq X/v\atop{u\equiv
a\overline{v}(q)}}d_{k}(u)$ $\displaystyle=$
$\displaystyle\frac{X}{q}\sum_{u\leq
y\atop{(u,q)=1}}\frac{d_{k}(u)}{u}+\frac{1}{q}\sum_{v<X/y\atop{(v,q)=1}}\left\\{\frac{X\mathcal{N}_{X/v}^{k-2}(q,1)}{v}-y\mathcal{N}_{y}^{k-2}(q,1)\right\\}+\mathcal{O}\left(y+\frac{q^{\Delta/2}X}{y^{\Delta}}+\frac{X}{y^{\delta}}\right).$

From part (A), (6) and (12) we get a main term
$X\mathcal{N}_{X,y}^{k-1}(q,1)/q$ and an error term

$\displaystyle\ll\frac{X}{qy^{\theta}}+y+\frac{q^{\Delta/2}X}{y^{\Delta}}+\frac{X}{y^{\delta}}.$

Note that

$\theta\geq\delta\hskip
28.45274pt\frac{\delta}{1+\delta}=\frac{\Delta(1-\delta/2)}{1+\delta}=\left(1+\frac{\delta\Delta}{2(1+\delta)}\right)\frac{\delta}{1+\Delta}$

so if $q\leq X^{\delta/(1+\delta)}$ choose $y=X^{1/(1+\delta)}$ and if $q\geq
X^{\delta/(1+\delta)}$ choose $y=\left(q^{\Delta/2}X\right)^{1/(1+\Delta)}$ \-
in both cases we get a total error

$\ll\left(q^{\Delta/2}X\right)^{1/(1+\Delta)}+X^{1-\delta/(1+\delta)}$

so we’re done. (D) From parts (A) and (C)

$\sum_{n\leq
X\atop{d|n}}d_{k}(n)=\frac{Xf_{X}(d,d)}{d}+\mathcal{O}\left(\left(\frac{X}{d}\right)^{1-\theta}\right)$

so the sum in question is

$\displaystyle
X\sum_{D|d|q}\frac{\mu(q/d)\phi(D)\mathcal{M}_{X}(D)}{D}+\mathcal{O}\left(X^{1-\theta}q^{\theta}\right).$

∎

Next we use the previous lemma for our circle method input.

######  Lemma 2.

Let $\mathcal{M}_{X}(q)$ be as in Lemma 1 and let

$\Delta_{X}(a/q)=\sum_{n\leq
X}d_{k}(n)e(na/q)-\frac{X\mathcal{M}_{X}\left(q/(q,a)\right)}{q/(q,a)}.$

Then for $1\leq Q,\gamma\leq x$ and errors
$\mathcal{O}_{\epsilon}\left(x^{\epsilon}\cdot\cdot\hskip
2.84526pt\cdot\right)$

$\displaystyle\sum_{q\leq\gamma}\frac{1}{q}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\max_{X\leq
x}|\Delta_{X}(a/q)|^{2}$ $\displaystyle\ll$ $\displaystyle
x\gamma+\underbrace{x^{2-1/k}}_{k>2}$
$\displaystyle\sum_{q\leq\gamma}\frac{1}{q^{2}}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\max_{X\leq
x}|\Delta_{X}(a/q)|^{2}$ $\displaystyle\ll$ $\displaystyle
x+\underbrace{x^{2-8/(6k-3)}}_{k>2}.$

Letting $f_{X}(q,n)$ be as in Lemma 1 we see that

$\frac{1}{q}\sum_{n=1}^{q}f_{X}(q,n)e\left(\frac{nb}{q}\right)=\frac{\mathcal{M}\left(q/(q,b)\right)}{q/(q,b)}$

so letting $E_{x}(q,a)$ and $V(x,Q)$ be as in our theorems we have

$\displaystyle\sum_{a=1}^{q}|E_{x}(q,a)|^{2}$ $\displaystyle=$
$\displaystyle\frac{1}{q}\sum_{a=1}^{q}|\Delta_{x}(a/q)|^{2}$ (15)

and therefore

$V(x,Q)\ll\sum_{q\leq
Q}\frac{\log(Q/q)+1}{q}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}|\Delta_{x}(a/q)|^{2}$

so the lemma implies Theorem 2.

###### Proof.

Let $X\leq x$ and drop $x^{\epsilon}$ and $\log x$ factors from error terms.
For $k=2$ Theorem 1.1 of [2] says the LHS of (15) is $\ll X+q$ so let’s assume
$k>2$. Take a parameter $0<R\leq\gamma$ and use (15) to write

$\displaystyle\sum_{q\leq\gamma}\frac{1}{q}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}|\Delta_{X}(a/q)|^{2}$
$\displaystyle\hskip 2.84526pt=\hskip 2.84526pt$
$\displaystyle\left(\sum_{q\leq
R}+\sum_{R<q\leq\gamma}\right)\frac{1}{q}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}|\Delta_{X}(a/q)|^{2}$
$\displaystyle=:A$
$\displaystyle\sum_{q\leq\gamma}\frac{1}{q^{2}}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}|\Delta_{X}(a/q)|^{2}$
$\displaystyle\hskip 2.84526pt\leq\hskip 2.84526pt$ $\displaystyle\sum_{q\leq
R}\frac{1}{q}\sum_{a=1}^{q}|E_{X}(a/q)|^{2}+\sum_{R<q\leq\gamma}\frac{1}{q^{2}}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}|\Delta_{X}(a/q)|^{2}$
$\displaystyle=:B.\hskip 2.84526pt$

A large sieve inequality says

$\sum_{q\leq\gamma}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}|\Delta_{X}(a/q)|^{2}\ll
X\gamma^{2}+X^{2}$

so from Lemma 1 (B)

$\displaystyle A$ $\displaystyle\ll$ $\displaystyle
X^{2-2\Delta}R^{1+2\Delta}+X^{2-\Delta}R^{\Delta}+X\gamma+\frac{X^{2}}{R}\ll
X\gamma+X^{2-1/k}$

on choosing $R=X^{1/k}$ whilst from Lemma 1 (C)

$\displaystyle B$ $\displaystyle\ll$ $\displaystyle
X^{2-2\Delta}R^{1+\Delta}+X^{2-2\delta}R+X+\frac{X^{2}}{R^{2}}\ll
X^{2-4\delta/3}$

on choosing $R=X^{2\delta/3}$ and perhaps noting
$\delta\Delta/3\leq\Delta-\delta$. ∎

At one point we’ll want to apply a variant of Perron’s formula.

######  Lemma 3.

Take $\Phi:\mathbb{N}\rightarrow\mathbb{C}$ with

$\mathcal{F}(s)=\sum_{N=1}^{\infty}\frac{\Phi(N)}{N^{s}}\hskip
28.45274pt\text{ absolutely convergent for }\sigma>1.$

For $X\geq 1$ suppose that $K_{X}:\mathbb{C}\rightarrow\mathbb{C}$ satisfies:

$\displaystyle\hskip 14.22636pt-$ $\displaystyle K_{X}\text{ is holomorphic
except for possibly poles at $s\in\\{0,-1,...\\}$}$ $\displaystyle\hskip
14.22636pt-$ $\displaystyle\text{for all $R\in\mathbb{N}$ and $\sigma>-R-1$
with $s\not\in\\{0,-1,...\\}$}\hskip
28.45274ptK_{X}(s)\ll_{\epsilon}\frac{X^{\sigma+\epsilon}}{|s|}\sum_{r=1}^{R}\frac{X^{r}}{|(s+1)\cdot\cdot\cdot(s+r)|}$
$\displaystyle\hskip 14.22636pt-$
$\displaystyle\sum_{poles}Res\Bigg{\\{}\frac{K_{X}(s)}{N^{s}}\Bigg{\\}}\hskip
14.22636pt\text{ converges for any $N\in\mathbb{N}$}.$

Then for $X,Q\geq 1$ with $X/Q\not\in\mathbb{Z}$, $d\in\mathbb{R}$ and
$c>1-d,0$

$\displaystyle\sum_{N\leq
X/Q}\frac{\Phi(N)}{N^{d}}\sum_{poles}Res\Bigg{\\{}\frac{K_{X}(s)}{(QN)^{s}}\Bigg{\\}}=\int_{c\pm
i\infty}\frac{\mathcal{F}(s+d)K_{X}(s)ds}{Q^{s}}.$

###### Proof.

Take integer $R>X$ so that on the contour $\mathcal{C}$ consisting of the
straight lines connecting

$c+iR\hskip 19.91692pt-R-1/2+iR\hskip 19.91692pt-R-1/2-iR\hskip 19.91692ptc-
iR\hskip 19.91692pt\text{ we have }\hskip
14.22636ptK_{X}(s)\ll\frac{X^{\sigma+\epsilon}e^{X}}{t}$

and therefore

$\displaystyle\int_{\mathcal{C}}\frac{K_{X}(s)ds}{(QN)^{s}}\ll
X^{\epsilon}e^{X}\left(\frac{(X/QN)^{-R-1/2}+(X/QN)^{c}}{R|\log(X/QN)|}+(X/QN)^{-R}\log
R\right)$

so by the Residue Theorem and pushing $R\rightarrow\infty$

$\int_{c\pm
i\infty}\frac{K_{X}(s)}{(QN)^{s}}ds=\sum_{\text{poles}}Res\Bigg{\\{}\frac{K_{X}(s)}{(QN)^{s}}\Bigg{\\}}$

as long as $QN<X$. If $QN>X$ a similar argument but taking the rectangle to
the right shows this last integral to be zero and we’re done. ∎

Now we apply the last result to what will be our case of interest.

######  Lemma 4.

For $f:[1,\infty)\rightarrow\mathbb{R}$ integrable and
$\Phi:\mathbb{N}\rightarrow\mathbb{C}$ with
$\Phi(N)\ll_{\epsilon}N^{\epsilon}$ define for $X\geq 1$ and $\sigma>1$

$\displaystyle F(X)$ $\displaystyle=$ $\displaystyle\int_{1}^{X}f(t)dt\hskip
17.07164pt\text{ and }\hskip
17.07164pt\mathcal{F}(s)=\sum_{N=1}^{\infty}\frac{\Phi(N)}{N^{s}}.$

If $f$ is smooth with $f^{(n)}(X)\ll_{n}X^{\epsilon-n}$ for all $n\geq 0$ then
for $X-1,Q\geq 1$ and $c>0$

$\displaystyle\sum_{u\leq(X-1)/Q}\frac{\Phi(u)}{u}F(X-uQ)$ $\displaystyle=$
$\displaystyle\int_{c\pm i\infty}\frac{\alpha(s+1)K_{X}(s)ds}{Q^{s}}$

where $K_{X}(s)$ satisfies the following properties:

$\displaystyle\hskip 14.22636pt-$ $\displaystyle K_{X}(s)\text{ is holomorphic
except for possibly poles at $s\in\\{0,-1,...\\}$}$ $\displaystyle\hskip
14.22636pt-$ $\displaystyle\text{for $R\in\mathbb{N}$ and $\sigma>-(R+1)$ with
$s\not\in\\{0,-1,...\\}$}\hskip
28.45274ptK_{X}(s)\ll\sum_{r=1}^{R}\frac{(X-1)^{\sigma+r+\epsilon}}{|s\cdot\cdot\cdot(s+r)|}$
$\displaystyle\hskip 14.22636pt-$ $\displaystyle\text{for $\sigma>-2$ with
$s\not\in\\{0,-1\\}$}\hskip
14.22636pt\int_{1}^{X}g(t)K_{t}(s)dt\ll\frac{X^{\sigma+2+\epsilon}}{|s(s+1)(s+2)|}\hskip
14.22636pt\text{for $g$ with }\left\\{\begin{array}[]{ll}g(X)\ll 1\\\
g^{\prime}(X)\ll X^{\epsilon-1}.\end{array}\right.$

Further, if $f(t)=(\log t)^{D}$ for $D\in\mathbb{N}\cup\\{0\\}$ then

$\displaystyle\hskip 14.22636pt-$
$\displaystyle\frac{K_{X}(s)}{Q^{s}}=\frac{X}{s}\sum_{n=0}^{\infty}P_{n}(X,Q)s^{n}\hskip
14.22636pt\text{ for }|s|<1$ $\displaystyle\hskip 14.22636pt-$
$\displaystyle\frac{K_{X}(s)}{Q^{s}}=\frac{Q}{s+1}\sum_{n\geq
0}P_{n}(X,Q)(s+1)^{n}\hskip 14.22636pt\text{ for }|s+1|<1$

where the $P_{n}(X,Q)$ are polynomials in $\log X,\log Q$ of degree $\leq
D+n$.

###### Proof.

Define111should $K_{X}(s)$ come across as unmotivated then notice it is
essentially the Mellin transform  $\int_{0}^{\infty}w_{X}(z)z^{s-1}dz\hskip
14.22636pt\text{ of }\hskip
14.22636ptw_{X}(z)=F(X(1-z))\left\\{\begin{array}[]{ll}1&\text{ if }z<1-1/X\\\
0&\text{ if }z>1+1/X\end{array}\right.$ for $\sigma>-1$ and $s\not=0$

$\displaystyle K_{X}(s)$ $\displaystyle=$
$\displaystyle\frac{1}{s}\int_{0}^{X-1}f(X-W)W^{s}dW.$

Integrating any $R\geq 0$ times we get for $\sigma>-(R+1)$ and
$s\not\in-\mathbb{N}\cup\\{0\\}$

$\displaystyle K_{X}(s)$ $\displaystyle=$
$\displaystyle\sum_{r=1}^{R}\frac{f^{(r-1)}(1)(X-1)^{s+r}}{s\cdot\cdot\cdot(s+r)}+\frac{1}{s\cdot\cdot\cdot(s+R)}\int_{0}^{X-1}f^{(R)}(X-W)W^{s+R}dW.$
(17)

A classical argument using Morera’s Theorem says that this integral is
holomorphic for $\sigma>-(R+1)$ and the first two claimed properties of
$K_{x}(s)$ follow, as does

$Res_{s=-R}\\{K_{X}\\}=\frac{F^{(R)}(X)}{(-R)!}.$ (18)

The third property follows since for $\sigma>-2$ with $s\not\in\\{0,-1\\}$

$\displaystyle\int_{1}^{X}g(t)K_{t}(s)dt$ $\displaystyle=$
$\displaystyle\frac{1}{s}\int_{1}^{X}f(V)\int_{V}^{X}g(t)(t-V)^{s}dtdV$
$\displaystyle=$
$\displaystyle\frac{1}{s(s+1)}\int_{1}^{X}f(V)\left(g(X)(X-V)^{s+1}-\int_{V}^{X}g^{\prime}(t)(t-V)^{s+1}dtdV\right)$
$\displaystyle=$
$\displaystyle\frac{g(X)}{s(s+1)(s+2)}\left(f(1)(X-1)^{s+2}+\int_{1}^{X}f^{\prime}(V)(X-V)^{s+2}dV\right)-\frac{1}{s}\int_{1}^{X}g^{\prime}(t)K_{t}(s+1)dt$

which we can bound using the second property. From (18)

$\displaystyle\sum_{\text{poles}}Res\Bigg{\\{}\frac{K_{X}(s)}{(Qu)^{s}}\Bigg{\\}}$
$\displaystyle=$
$\displaystyle\int_{0}^{X-1}f(X-W)dW+\sum_{R=1}^{\infty}\frac{F^{(R)}(X)}{R!}\left(-Qu\right)^{R}=F(X-Qu)$

so the main claim follows from the first and second properties and from Lemma
3, and now we turn to the series expansions. As

$X^{s+1}=\sum_{n\geq 0}\frac{(s+1)^{n}(\log X)^{n}}{n!}\hskip 17.07164pt\text{
and }\hskip 17.07164pt-\frac{1}{s}=\sum_{n\geq 0}(s+1)^{n}$

we get from (17)

$\displaystyle\frac{K_{X}(s)}{Q^{s}}$ $\displaystyle=$
$\displaystyle\frac{Q}{s(s+1)}\sum_{n\geq
0}\frac{(s+1)^{n}}{n!}\left(\underbrace{f(1)\left(\log\left(\frac{X-1}{Q}\right)\right)^{n}+\int_{0}^{X-1}f^{\prime}(X-W)\left(\log\left(\frac{W}{Q}\right)\right)^{n}dW}_{\text{degree
$\leq n+D$ polynomial}}\right)$ $\displaystyle=$
$\displaystyle\frac{Q}{s+1}\sum_{l\geq 0}(s+1)^{l}\sum_{n+m=l}\frac{P_{n}(\log
X,\log Q)}{n!}$

and the expansion about $s=0$ is similar. ∎

The remaining lemmas are concerned with writing the Dirichlet series arising
from applying Perron’s formula as ultimately a product of the Riemann zeta
function and its derivatives. The expression we want is Lemma 6 and the
inductive step for general $k$ is Lemma 5.

######  Notation 1.

Here we explain what we mean with the notation

$\mathcal{O}^{*}\hskip 14.22636ptd_{k}^{w}\hskip 14.22636ptf_{k}^{q}\hskip
14.22636pt\theta\hskip 14.22636pt\Delta\hskip
14.22636ptF_{k}^{s,w,w^{\prime}}\hskip 14.22636ptF_{k}^{s}$

which we use in Lemmas 5 and 6. If
$E_{s,w,w^{\prime}}:\mathbb{N}\rightarrow\mathbb{C}$

$\displaystyle-\hskip 5.69054pt\text{is holomorphic for $\sigma>0$ and
differentiable for $w,w^{\prime}\geq 0$}$ $\displaystyle-\hskip
5.69054pt\text{is $>-1$ for $s$ real and positive}$ $\displaystyle-\hskip
5.69054pt\text{is }\mathcal{O}(1/p^{\sigma})\hskip 14.22636pt\text{for }\hskip
14.22636pt\text{primes $p$}\hskip 14.22636ptN\geq 1\hskip
14.22636pt\sigma>0\hskip 14.22636ptw,w^{\prime}\geq 0$

then write
$E_{s,w,w^{\prime}}(p^{N})=\mathcal{O}^{*}\left(1/p^{\sigma}\right)$. For
$k\in\mathbb{N}$ and $w\in\mathbb{C}$ define
$d_{k}^{w}:\mathbb{N}\rightarrow\mathbb{C}$ through

$d_{k}^{w}(n)=\sum_{u_{1}\cdot\cdot\cdot u_{k}=n}\frac{1}{u_{k}^{w}}$

and if there is multiplcative $f_{k}$ such that

$f_{k}\left(p^{N}\right)=d_{k}^{w}\left(p^{N}\right)+\mathcal{O}_{N,k}^{*}\left(1/p^{\sigma}\right)$

then say that $f_{k}$ is an $\mathcal{S},\mathcal{W}$-function. If
$\Delta:\mathbb{N}\rightarrow\mathbb{C}$ is only squarefree kernel dependent
and satisfies

$\Delta(p)=1+\mathcal{O}^{*}\left(1/p^{\sigma}\right).$

then say that $\Delta$ is an $\mathcal{S},\mathcal{W}$-function. If we repeat
this discussion but without $w,w^{\prime}$ parameters call $f_{k}$ and
$\Delta$ just $\mathcal{S}$-functions. Write $\theta$ for a function
$\mathbb{N}\times\mathbb{N}\rightarrow\mathbb{C}$ which

$\displaystyle-\hskip 5.69054pt\text{is positive and $\ll 1$ for real and
positive $s$}$ $\displaystyle-\hskip 5.69054pt\text{is multiplicative in both
arguments}$ $\displaystyle-\hskip 5.69054pt\text{is only squarefree kernel
dependent in the second argument}$

and then for given $\theta$ and multiplicative
$f:\mathbb{N}\rightarrow\mathbb{C}$ write $f^{q}(n)=f(n)\theta(n,q)$.

We make the convention that we use the same letters for all these functions
even when the functions themselves may differ - their properties however
remain intact. For $N,N^{\prime}\in\mathbb{N}$ write
$\mathcal{N}=(N,N^{\prime})$. Write $F_{k}^{s,w,w^{\prime}}(N,N^{\prime})$ for
a product of the form

$\displaystyle
f_{k}^{\mathcal{N}}\left(N/\mathcal{N}\right)f_{k}^{\mathcal{N}}\left(N^{\prime}/\mathcal{N}\right)\Delta(\mathcal{N})$

where each function is an $\mathcal{S},\mathcal{W}$-function and similarly
write $F_{k}^{s}(N,N^{\prime})$ for the corresponding product with
$\mathcal{S}$-functions.

$\hskip 312.9803pt\blacksquare$

######  Lemma 5.

Assume the notation of Notation 1 and define for $\sigma>1$ and
$w,w^{\prime}\geq 0$

$\displaystyle\mathcal{R}_{N,N^{\prime}}^{w,w^{\prime}}(s)$ $\displaystyle=$
$\displaystyle\sum_{r,r^{\prime}=1}^{\infty}\frac{F_{k}^{s}\left(rN,r^{\prime}N^{\prime}\right)}{[rN,r^{\prime}N^{\prime}]^{s}r^{w}r^{\prime
w^{\prime}}}\hskip 14.22636pt\text{ and }\hskip
14.22636pt\mathcal{H}_{N,N^{\prime}}^{w,w^{\prime}}(s)=\sum_{h,h^{\prime}=1}^{\infty}\frac{\mu(h)\mu(h^{\prime})F_{k}^{s}\left([h,N],[h^{\prime},N^{\prime}]\right)}{hh^{\prime}[[h,N],[h^{\prime},N^{\prime}]]^{s}h^{w}h^{\prime
w^{\prime}}}.$

Then for $s=\sigma>1$ and $w,w^{\prime}\geq 0$

$\displaystyle\text{(A)}\hskip
28.45274pt\mathcal{R}_{N,N^{\prime}}^{w,w^{\prime}}(s)=\frac{\zeta(s+w+w^{\prime})\zeta(s+w)^{k}\zeta(s+w^{\prime})^{k}\mathcal{\lambda}_{w,w^{\prime}}(s)F_{k+1}^{s,w,w^{\prime}}\left(N,N^{\prime}\right)}{[N,N^{\prime}]^{s}}$
$\displaystyle\text{(B)}\hskip
28.45274pt\mathcal{H}_{N,N^{\prime}}^{w,w^{\prime}}(s)=\frac{\lambda_{w,w^{\prime}}(s)F_{k}^{s,w,w^{\prime}}\left(N,N^{\prime}\right)}{[N,N^{\prime}]^{s}}$

where
$\lambda_{w,w^{\prime}}:\\{s\in\mathbb{C}|\sigma>1/2\\}\rightarrow\mathbb{C}$
is holomorphic and $\ll 1$.

###### Proof.

Before turning to the claims themselves we need some preparatory work. If
$d\in\mathbb{N}$ appears in a $p$-factor of an Euler product then read $d$ as
“the highest power of $p$ which divides $d$”. For any $x,d\in\mathbb{N}$

$\displaystyle\sum_{R=1}^{\infty}\frac{\theta(x,Rd)\Delta(Rd)}{R^{s+w+w^{\prime}}}=\prod_{p}\underbrace{\left(\sum_{R\geq
0}\frac{\theta(x,p^{R}d)\Delta(p^{R}d)}{p^{R(s+w+w^{\prime})}}\right)}_{=:\mathfrak{f}_{x,d}}$

where $\mathfrak{f}_{1,1}=1+\mathcal{O}^{*}\left(1/p^{\sigma}\right)$. This
product is

$\displaystyle\prod_{p}\mathfrak{f}_{1,1}\prod_{p|xd}\frac{\mathfrak{f}_{x,d}}{\mathfrak{f}_{1,1}}=:\prod_{p}\mathfrak{f}_{1,1}\prod_{p|xd}\mathfrak{g}_{x,d}$

and here the infinite product is

$\displaystyle\zeta(s+w+w^{\prime})\prod_{p}\left(1+\mathcal{O}^{*}\left(\frac{1}{p^{2\sigma+w+w^{\prime}}}\right)\right)$

and the finite product

$\displaystyle\prod_{p|x}\mathfrak{g}_{x,1}\prod_{p|d}\mathfrak{g}_{1,p}\prod_{p|x,d}\frac{\mathfrak{g}_{x,p}}{\mathfrak{g}_{x,1}\mathfrak{g}_{1,p}}=f_{1}(x)\Delta(d)\theta(x,d)$

so for any $x,d\in\mathbb{N}$

$\displaystyle\sum_{R=1}^{\infty}\frac{f_{k}^{Rd}(x)\Delta(Rd)}{R^{s+w+w^{\prime}}}=\zeta(s+w+w^{\prime})\lambda_{w,w^{\prime}}(s)f_{k}(x)\theta(x,d)\Delta(d).\hskip
28.45274pt$ (19)

We also have

$\displaystyle\sum_{H,h,h^{\prime}=1\atop{(h,h^{\prime})=1\atop{(hh^{\prime},q)=1\atop{(H,hh^{\prime}q)=1}}}}^{\infty}\frac{\Delta(H)f_{k}(h)f_{k}(h^{\prime})}{H^{2+s+w+w^{\prime}}h^{1+s+w}h^{\prime
1+s+w^{\prime}}}$ $\displaystyle=$
$\displaystyle\lambda_{w,w^{\prime}}(s)\sum_{h,h^{\prime}=1\atop{(h,h^{\prime})=1\atop{(hh^{\prime},q)=1}}}^{\infty}\frac{\Delta(hh^{\prime}q)f_{k}(h)f_{k}(h^{\prime})}{h^{1+s+w}h^{\prime
1+s+w^{\prime}}}$ $\displaystyle=$
$\displaystyle\lambda_{w,w^{\prime}}(s)\Delta(q)\sum_{n=1\atop{(n,q)=1}}^{\infty}\frac{f_{k}(n)}{n^{1+s+w+w^{\prime}}}$

so that a similar calculation to that just done leads to

$\displaystyle\sum_{H,h,h^{\prime}=1\atop{(h,h^{\prime})=1\atop{(hh^{\prime},q)=1\atop{(H,hh^{\prime}q)=1}}}}^{\infty}\frac{\Delta(H)f_{k}(h)f_{k}(h^{\prime})}{H^{2+s+w+w^{\prime}}h^{1+s+w}h^{\prime
1+s+w^{\prime}}}=\lambda_{w,w^{\prime}}(s)\Delta(q).$ (20)

Now we turn to the claims of the lemma. Any boldface letter, say $\mathbf{v}$,
will be understood to mean a two-dimensional vector, written
$\mathbf{v}=(v,v^{\prime})$, and we then write
$\mathbf{v}^{\prime}=(v^{\prime},v)$. A function with a vector appearing in
its argument, say $f(\mathbf{v})$, is to be understood to mean
$f(v)f(v^{\prime})$. A condition $(\mathbf{a},\mathbf{b})=1$ will mean
$(a,b)=(a^{\prime},b^{\prime})=1$ and $\mathbf{d}|\mathbf{n}$ will mean $d|n$
and $d^{\prime}|n^{\prime}$. Write $\mathcal{N}=(N,N^{\prime})$. (A) For any
$a,b\in\mathbb{N}$

$(ab,a^{\prime}b^{\prime})=(a,a^{\prime})\left(\frac{a}{(a,a^{\prime})},\frac{b^{\prime}}{(b,b^{\prime})}\right)\left(\frac{b}{(b,b^{\prime})},\frac{a^{\prime}}{(a,a^{\prime})},\right)(b,b^{\prime})$

so using (19) and writing $\mathbf{M}=\mathbf{N}/\mathbf{n}\mathcal{N}$

$\displaystyle\mathcal{R}_{N,N^{\prime}}^{w,w^{\prime}}(s)$ $\displaystyle=$
$\displaystyle\frac{1}{[N,N^{\prime}]^{s}}\sum_{\mathbf{n}|\mathbf{N}/\mathcal{N}}\frac{1}{{n^{\prime}}^{w}n^{w^{\prime}}}\sum_{R,r,r^{\prime}=1\atop{(r,r^{\prime})=1\atop{(\mathbf{r},\mathbf{n}\mathbf{M}^{\prime})=1}}}^{\infty}\frac{f_{k}^{Rnn^{\prime}\mathcal{N}}\left(\mathbf{r}\mathbf{M}\right)\Delta(Rnn^{\prime}\mathcal{N})}{R^{s+w+w^{\prime}}(rr^{\prime})^{s}r^{w}r^{\prime
w^{\prime}}}$ $\displaystyle=$
$\displaystyle\frac{\zeta(s+w+w^{\prime})\lambda_{s}(w,w^{\prime})}{[N,N^{\prime}]^{s}}\sum_{\mathbf{n}|\mathbf{N}/\mathcal{N}}\frac{\Delta(nn^{\prime}\mathcal{N})}{{n^{\prime}}^{w}n^{w^{\prime}}}\sum_{r,r^{\prime}=1\atop{(r,r^{\prime})=1\atop{(\mathbf{r},\mathbf{n}\mathbf{M}^{\prime})=1}}}^{\infty}\frac{f_{k}^{nn^{\prime}\mathcal{N}}\left(\mathbf{r}\mathbf{M}\right)}{(rr^{\prime})^{s}r^{w}r^{\prime
w^{\prime}}}$ $\displaystyle=$
$\displaystyle\frac{\zeta(s+w+w^{\prime})\lambda_{s}(w,w^{\prime})}{[N,N^{\prime}]^{s}}\Delta(\mathcal{N})\sum_{\mathbf{n}|\mathbf{N}/\mathcal{N}}\frac{\Delta_{\mathcal{N}}(\mathbf{n})}{n^{\prime
w}n^{w^{\prime}}}\sum_{l=1}^{\infty}\frac{a_{\mathbf{n},\mathbf{M},nn^{\prime}\mathcal{N}}(l)}{l^{s}}$

where

$a_{\mathbf{n},\mathbf{M},nn^{\prime}\mathcal{N}}(l)=\sum_{rr^{\prime}=l\atop{(r,r^{\prime})=1\atop{(\mathbf{r},\mathbf{n}\mathbf{M}^{\prime})=1}}}\frac{f_{k}^{nn^{\prime}\mathcal{N}}(\mathbf{r}\mathbf{M})}{r^{w}r^{\prime
w^{\prime}}}.$

Make the same convention for $M,M^{\prime}$ as for $d$ in the second sentence
of this proof. The $l$ series above is

$\displaystyle\prod_{p}\underbrace{\left(\sum_{l\geq
0}\frac{a_{\mathbf{n},\mathbf{M},nn^{\prime}\mathcal{N}}(p^{l})}{p^{ls}}\right)}_{=:\mathfrak{a}_{\mathbf{n},\mathbf{M},nn^{\prime}\mathcal{N}}}=\prod_{p|NN^{\prime}}\underbrace{\frac{\mathfrak{a}_{\mathbf{n},\mathbf{M},nn^{\prime}\mathcal{N}}}{\mathfrak{a}_{\mathbf{1}}}}_{=:\mathfrak{b}_{\mathbf{n},\mathbf{M},nn^{\prime}\mathcal{N}}}\underbrace{\prod_{p}\mathfrak{a}_{\mathbf{1}}}_{=:\mathcal{A}(w,w^{\prime})}$

and here the finite product is

$\displaystyle\prod_{p|N/\mathcal{N}}\mathfrak{b}_{n,1,N/n\mathcal{N},1,n\mathcal{N}}\prod_{p|N^{\prime}/\mathcal{N}}\mathfrak{b}_{1,n^{\prime},1,N^{\prime}/n^{\prime}\mathcal{N},n^{\prime}\mathcal{N}}\prod_{p|\mathcal{N}\atop{p\nmid
NN^{\prime}/\mathcal{N}^{2}}}\mathfrak{b}_{1,1,1,1,p}=:b_{\mathbf{n},\mathcal{N}}\left(\mathbf{N}/\mathcal{N}\right)b_{NN^{\prime}/\mathcal{N}^{2}}(\mathcal{N})$

so

$\displaystyle\mathcal{R}_{N,N^{\prime}}^{w,w^{\prime}}(s)$ $\displaystyle=$
$\displaystyle\frac{\zeta(s+w+w^{\prime})\lambda_{w,w^{\prime}}(s)\mathcal{A}(w,w^{\prime})}{[N,N^{\prime}]^{s}}b_{NN^{\prime}/\mathcal{N}^{2}}(\mathcal{N})B_{\mathcal{N}}\left(\mathbf{N}/\mathcal{N}\right)\hskip
28.45274pt$ (21)

where

$\displaystyle B_{q}(N)$ $\displaystyle:=$
$\displaystyle\sum_{n|N}\frac{\Delta_{q}(n)f_{k}^{nq}(N/n)b_{n,q}(N)}{n^{w^{\prime}}}=:\sum_{n|N}\underbrace{\lambda_{N,q}(n)b_{n,q}(N)}_{\text{multiplicative}}=B_{1}(N)\prod_{p|N,q}\frac{B_{p}(p^{N})}{B_{1}(p^{N})}$

so we’re done if we show

$\displaystyle\mathcal{A}_{s}(w,w^{\prime})=\zeta(s+w)^{k}\zeta(s+w^{\prime})^{k}\lambda_{w,w^{\prime}}(s)\hskip
19.91692pt\mathfrak{b}_{1,1,1,1,p}=1+\mathcal{O}^{*}\left(p^{-\sigma}\right)\hskip
19.91692ptB_{q}(N)=f_{k}^{q}(N).$ (22)

For $N$ a power of $p$ and any $q\in\mathbb{N}$

$\displaystyle\sum_{n|N}\lambda_{N,q}(n)$ $\displaystyle=$ $\displaystyle
d_{k+1}^{w^{\prime}}(N)+O^{*}\left(p^{-\sigma}\right)$

and for $l\geq 1$

$\displaystyle a_{n,1,N/n,1,nq}(p^{l})$ $\displaystyle=$
$\displaystyle\sum_{rr^{\prime}=p^{l}\atop{(r,r^{\prime})=1\atop{(r,n)=1\atop{(r^{\prime},N/n)=1}}}}\frac{f_{k}^{nq}\left(rN/n\right)f^{nq}(r^{\prime})}{r^{w}r^{\prime
w^{\prime}}}=\underbrace{\frac{f_{K}^{nq}\left(Np^{l}/n\right)}{p^{lw}}}_{p\nmid
n}+\underbrace{\frac{f_{k}\left(N/n\right)}{p^{lw^{\prime}}}}_{p\nmid N/n}$

so

$\displaystyle\sum_{l\geq
1}\frac{1}{p^{ls}}\sum_{n|N}\lambda_{N,q}(n)a_{n,1,N/n,1,nq}(p^{l})$
$\displaystyle=$ $\displaystyle\sum_{l\geq
1}\frac{1}{p^{ls}}\left(\frac{\Delta_{q}(1)f_{k}^{q}\left(Np^{l}\right)}{p^{lw}}+\frac{\Delta_{q}(N)f^{Nq}(p^{l})}{p^{lw^{\prime}}}\right)=\mathcal{O}_{N,k}^{*}\left(p^{-\sigma}\right)$

and we conclude that for $N$ a power of $p$ and for any $q\in\mathbb{N}$

$\displaystyle\mathfrak{a}_{\mathbf{1}}B_{q}(N)$ $\displaystyle=$
$\displaystyle d_{k+1}^{w^{\prime}}(N)+O_{N,k}^{*}\left(p^{-\sigma}\right).$
(23)

For $l$ a power of $p$

$\displaystyle a_{1,1,1,1,q}(l)$ $\displaystyle=$
$\displaystyle\left(\frac{f_{k}^{q}(l)}{l^{w}}+\frac{f^{q}(l)}{l^{w^{\prime}}}\right)\hskip
28.45274pt\text{so}\hskip 28.45274pt\sum_{l\geq
2}\frac{a_{1,1,1,1,q}(p^{l})}{p^{ls}}=\mathcal{O}_{k}^{*}\left(\frac{1}{p^{2\sigma}}\right)$

so

$\displaystyle\mathfrak{a}_{1,1,1,1,q}$ $\displaystyle=$ $\displaystyle
1+\frac{k}{p^{s}}\left(\frac{1}{p^{w}}+\frac{1}{p^{w^{\prime}}}\right)+\mathcal{O}_{k}^{*}\left(\frac{1}{p^{2\sigma}}\right)$
$\displaystyle=$
$\displaystyle\left(1+\frac{1}{p^{s+w}}\right)^{k}\left(1+\frac{k}{p^{s+w^{\prime}}}\right)^{k}+\mathcal{O}_{k}^{*}\left(\frac{1}{p^{2\sigma}}\right)$
$\displaystyle=$ $\displaystyle
1+\mathcal{O}_{k}^{*}\left(\frac{1}{p^{\sigma}}\right).$

The second equality here implies the first equality of (22), the third
equality here implies the second equality of (22), and the third equality here
with (23) implies the third equality of (22). (B) The sum in question is

$\displaystyle\left(\sum_{\mathbf{j}|\mathbf{N}}\frac{\mu(\mathbf{j})}{\mathbf{j}^{\mathbf{w}}}\right)\sum_{h,h^{\prime}=1\atop{(\mathbf{h},\mathbf{N})=1}}^{\infty}\frac{\mu(\mathbf{h})F(hN,h^{\prime}N^{\prime})}{\mathbf{h}[hN,h^{\prime}N^{\prime}]^{s}h^{w}h^{\prime
w^{\prime}}}$

and here the $\mathbf{h}$ sum is, as in (A) and writing
$\mathbf{M}=\mathbf{N}/\mathbf{n}\mathcal{N}$,

$\displaystyle\frac{1}{[N,N^{\prime}]^{s}}\sum_{\mathbf{n}|\mathbf{N}/\mathcal{N}\atop{(\mathbf{n},\mathcal{N})=1}}\frac{1}{\mathbf{n}^{1+\mathbf{w}^{\prime}}}\sum_{H,h,h^{\prime}=1\atop{(h,h^{\prime})=1\atop{(\mathbf{h},\mathbf{M}^{\prime}\mathbf{N})=1\atop{(H,\mathbf{N})=1}}}}^{\infty}\frac{\mu(\mathbf{h}\mathbf{n}^{\prime}H)f_{k}(\mathbf{h}\mathbf{M})\theta(\mathbf{h}\mathbf{M},Hnn^{\prime}\mathcal{N})\Delta(Hnn^{\prime}\mathcal{N})}{H^{2+s+w+w^{\prime}}\mathbf{h}^{1+s+\mathbf{w}}}$
$\displaystyle\hskip 56.9055pt{=}\hskip
11.38109pt\frac{\Delta(\mathcal{N})}{[N,N^{\prime}]^{s}}\left(\sum_{\mathbf{n}|\mathbf{N}/\mathcal{N}\atop{(\mathbf{n},\mathcal{N})=1}}\frac{\mu(\mathbf{n})f_{k}(\mathbf{M})\theta(\mathbf{M},\mathbf{n}\mathcal{N})\Delta(\mathbf{n})}{\mathbf{n}^{1+\mathbf{w}^{\prime}}}\right)\sum_{H,h,h^{\prime}=1\atop{(h,h^{\prime})=1\atop{(hh^{\prime},NN^{\prime})=1\atop{(H,hh^{\prime}NN^{\prime})=1}}}}^{\infty}\frac{\mu(\mathbf{h})\mu(H)^{2}f_{k}(\mathbf{h})\Delta(H)}{H^{2+s+w+w^{\prime}}\mathbf{h}^{1+s+\mathbf{w}}}.$

The $j$ sum is $\Delta(\mathbf{N})$, the $H,\mathbf{h}$ sum is
$\lambda_{w,w^{\prime}}(s)\Delta(NN^{\prime})$ from (20), and the $\mathbf{n}$
sum is $F_{\mathcal{N}}(\mathbf{N}/\mathcal{N})$ where

$\displaystyle F_{q}(N)$ $\displaystyle=$
$\displaystyle\sum_{n|N\atop{(n,q)=1}}\frac{\mu(n)f_{k}(N/n)\theta(N/n,nq)\Delta(n)}{n^{1+w^{\prime}}}=F_{1}(N)\prod_{p|N,q}\frac{F_{p}(p^{N})}{F_{1}(p^{N})}$

so putting everything together the sum in question is

$\displaystyle\frac{\lambda_{w,w^{\prime}}(s)\Delta(\mathbf{N})\Delta(NN^{\prime})\Delta(\mathcal{N})F_{\mathcal{N}}(\mathbf{N}/\mathcal{N})}{[N,N^{\prime}]^{s}}$

and we’re done on noting

$F_{q}(p^{N})=d_{k}^{w^{\prime}}(p^{N})+\mathcal{O}_{N,k}^{*}\left(p^{-1}\right).$

∎

######  Lemma 6.

Let $P(\cdot,...,\cdot)$ be a polynomial of degree $D$ in the variables
$\log(\cdot),...,\log(\cdot)$, take $k\in\mathbb{N}$, and write $Z=k(k+2)$.
Then for $\sigma>1$

$\displaystyle\sum_{q=1}^{\infty}\frac{\phi(q)/q}{q^{s}}\sum_{r_{k}|\cdot\cdot\cdot|r_{1}|q\atop{r_{k}^{\prime}|\cdot\cdot\cdot|r_{1}^{\prime}|q\atop{h_{1}|r_{1},...,h_{k}|r_{k}\atop{h_{1}^{\prime}|r_{1}^{\prime},...,h_{k}^{\prime}|r_{k}^{\prime}}}}}\frac{\mu(h_{1})\mu(h_{1}^{\prime})\cdot\cdot\cdot\mu(h_{k})\mu(h_{k}^{\prime})}{h_{1}h_{1}^{\prime}\cdot\cdot\cdot
h_{k}h_{k}^{\prime}}P(q,\mathbf{r},\mathbf{r}^{\prime},\mathbf{h},\mathbf{h}^{\prime})=\sum_{k_{i}\geq
0\atop{k_{0}+\cdot\cdot\cdot+k_{Z}\leq
D}}\lambda_{\mathbf{k}}(s)\zeta^{(k_{1})}(s)\cdot\cdot\cdot\zeta^{(k_{Z})}(s)$

where for $\sigma>1/2$ the $\lambda_{\mathbf{k}}(s)$ are holomorphic and $\ll
1$. The claim remains true for $k=0$ if we remove the
$r_{1},...,h_{k}^{\prime}$ sum and variables.

###### Proof.

Write $\lambda(s)$ for a quantity holomorphic and $\ll 1$ for $\sigma>1/2$,
let $\Delta,F_{K}^{s}$ be as given in Notation 1, and assume w.l.o.g. that
$s=\sigma$. From (19)

$\displaystyle\sum_{q=1}^{\infty}\frac{\Delta(qR)}{q^{s}}$ $\displaystyle=$
$\displaystyle\lambda(s)\zeta(s)\Delta(R)$

so the sum in question is

$\displaystyle\sum_{0\leq d\leq
D}\lambda_{d}(s)\zeta^{(D-d)}(s)\sum_{r_{k}|\cdot\cdot\cdot|r_{1}\atop{r_{k}^{\prime}|\cdot\cdot\cdot|r_{1}^{\prime}\atop{h_{1}|r_{1},...,h_{k}|r_{k}\atop{h_{1}^{\prime}|r_{1}^{\prime},...,h_{k}^{\prime}|r_{k}^{\prime}}}}}\frac{\mu(h_{1})\cdot\cdot\cdot\mu(h_{k}^{\prime})F_{1}^{s}(r_{k},r_{k}^{\prime})}{h_{1}\cdot\cdot\cdot
h_{k}^{\prime}[r,r^{\prime}]^{s}}P_{d}(\mathbf{r},\mathbf{r}^{\prime},\mathbf{h},\mathbf{h}^{\prime})\hskip
28.45274pt$ (24)

for some polynomials $P_{d}(\cdot,...,\cdot)$ in $\log(\cdot),...,\log(\cdot)$
of degree $d$. For $n,d\in\mathbb{N}\cup\\{0\\}$ write $P^{n,N}(s)$ for a
quantity of the form

$\sum_{k_{i}\geq 0\atop{k_{1}+\cdot\cdot\cdot+k_{n}\leq
N}}\lambda_{\mathbf{k}}(s)\zeta(s)^{(k_{1})}\cdot\cdot\cdot\zeta^{(k_{n})}(s)$

so that

$\displaystyle\frac{d}{dw^{\prime
R^{\prime}}w^{R}}\Bigr{|}_{\mathbf{w}=\mathbf{0}}\lambda_{w,w^{\prime}}(s)\zeta(s+w+w^{\prime})\zeta(s+w)^{K}\zeta(s+w^{\prime})^{K}=P^{2K+1,R+R^{\prime}}(s).\hskip
28.45274pt$ (25)

Define $\mathcal{R}_{N,N^{\prime}}^{w,w^{\prime}}(s)$ as in Lemma 5, define

$\mathcal{R}_{N,N^{\prime}}(s)=\sum_{r,r^{\prime}=1}^{\infty}\frac{(\log
r)^{R}(\log
r^{\prime})^{R^{\prime}}F_{K}\left(rN,r^{\prime}N^{\prime}\right)}{[rN,r^{\prime}N^{\prime}]^{s}}\hskip
14.22636pt\text{ so that }\hskip 17.07164pt\frac{d}{dw^{R}dw^{\prime
R^{\prime}}}R_{N,N^{\prime}}^{w,w^{\prime}}(s)\Bigr{|}_{\mathbf{w}=\mathbf{0}}=\mathcal{R}_{N,N^{\prime}}(s)$

and define

$\displaystyle\mathcal{F}_{\mathbf{N}}(s)$ $\displaystyle=$
$\displaystyle\sum_{h,h^{\prime}=1}^{\infty}\frac{\mu(h)\mu(h^{\prime})(\log
h)^{H}(\log
h^{\prime})^{H^{\prime}}\mathcal{R}_{[h,N],[h^{\prime},N^{\prime}]}(s)}{hh^{\prime}}.$
(26)

From Lemma 5 (A) and (25)

$\displaystyle\mathcal{R}_{N,N^{\prime}}(s)$ $\displaystyle=$
$\displaystyle\frac{P^{2K+1,R+R^{\prime}}(s)F_{K+1}^{s}\left(N,N^{\prime}\right)}{[N,N^{\prime}]^{s}}$

so

$\displaystyle\mathcal{F}_{\mathbf{N}}(s)$ $\displaystyle=$ $\displaystyle
P^{2K+1,R+R^{\prime}}(s)\sum_{h,h^{\prime}=1}^{\infty}\frac{\mu(h)\mu(h^{\prime})(\log
h)^{H}(\log
h^{\prime})^{H^{\prime}}F_{K+1}^{s}\left([h,N],[h^{\prime},N^{\prime}]\right)}{hh^{\prime}[[h,N],[h^{\prime},N^{\prime}]]^{s}}$

and reasoning similarly but using Lemma 5 (B) allows us to conclude

$\displaystyle\mathcal{F}_{\mathbf{N}}(s)$ $\displaystyle=$
$\displaystyle\frac{P^{2K+1,R+R^{\prime}}(s)F_{K+1}^{s}\left(N,N^{\prime}\right)}{[N,N^{\prime}]^{s}}.$
(27)

For $n,V,v_{1},...,v_{V}\in\mathbb{N}\cup\\{0\\}$ write
$P_{s}^{n}(\mathbf{v})$ for a quantity of the form

$\sum_{k_{i},V_{i}\geq
0\atop{k_{1}+\cdot\cdot\cdot+k_{n}+V_{1}+\cdot\cdot\cdot+V_{V}\leq
d}}\lambda_{\mathbf{k},\mathbf{V},d,n}(s)\zeta^{(k_{1})}(s)\cdot\cdot\cdot\zeta(s)^{(k_{n})}(\log
v_{1})^{V_{1}}\cdot\cdot\cdot(\log v_{V})^{V_{V}}$

so that (27) says

$\displaystyle\sum_{r,r^{\prime},h,h^{\prime}=1}^{\infty}\frac{\mu(h)\mu(h^{\prime})P_{s}^{n}(\mathbf{v},r,r^{\prime},h,h^{\prime})F_{K}^{s}\left(r[h,N],r^{\prime}[h^{\prime},N^{\prime}]\right)}{hh^{\prime}[r[h,N],r^{\prime}[h^{\prime},N^{\prime}]]^{s}}=\frac{P_{s}^{n+2K+1}(\mathbf{v})F_{K+1}^{s}\left(N,N^{\prime}\right)}{[N,N^{\prime}]^{s}}.$

The polynomial in (24) is
$P_{s}^{0}(\mathbf{r},\mathbf{r}^{\prime},\mathbf{h},\mathbf{h}^{\prime})$ so
applying the above equality $k$ times the $r_{1},...,h+k^{\prime}$ sum in (24)
becomes $P^{k(k+2),d}(s)$ and the result follows. ∎

##  3 \- Proof of Theorem 1

Let $V(x,Q)$ be as given in our Theorem 1 and in view of Theorem 2 take large
real numbers $\sqrt{x}\leq Q=o(x)$. Let $\gamma$ be a parameter at our
disposal subject to $2\sqrt{x}\leq\gamma\leq x$. Throughout we will drop
$x^{\epsilon}$ and $\log x$ factors from our error terms and the implied
constants will depend on $k,\epsilon$.

On opening up the square in $V(x,Q)$ we have

$\displaystyle V(x,Q)$ $\displaystyle=$ $\displaystyle\sum_{q\leq
Q}\sum_{n,m\leq x\atop{n\equiv m(q)}}d_{k}(n)d_{k}(m)-2x\sum_{q\leq
Q}\frac{1}{q}\sum_{n\leq x}d_{k}(n)f_{x}(q,n)+x^{2}\sum_{q\leq
Q}\frac{1}{q^{2}}\sum_{a=1}^{q}f_{x}(q,a)^{2}\hskip 28.45274pt$ (28)

where $f_{x}(q,a)$ is as in Lemma 1. If $c_{q}(n)$ is Ramanujan’s sum then for
$d,d^{\prime}|q$

$\displaystyle\sum_{a=1}^{q}c_{d}(a)c_{d^{\prime}}(a)=q\left\\{\begin{array}[]{ll}\phi(d)&\text{
if }d=d^{\prime}\\\ 0&\text{ if }d\not=d^{\prime}\end{array}\right.$

so

$\displaystyle\sum_{a=1}^{q}f_{x}(q,a)^{2}$ $\displaystyle=$ $\displaystyle
q\sum_{d|q}\frac{\phi(d)\mathcal{M}_{x}(d)^{2}}{d^{2}}=:qf_{x}^{*}(q)$

where, for some polynomial $P$ of degree $\leq 2k-1$,

$\displaystyle\sum_{q\leq
Q}\frac{f_{x}^{*}(q)}{q}=\underbrace{\sum_{d=1}^{\infty}\frac{\phi(d)f_{x}(d)^{2}(\log(Q/d)+\gamma)}{d^{3}}}_{=P(\log
x,\log Q)}+\mathcal{O}\left(\frac{1}{Q}\right)$

whilst from Lemma 1 (D)

$\displaystyle\sum_{n\leq x}d_{k}(n)f_{x}(q,n)$ $\displaystyle=$
$\displaystyle xf_{x}^{*}(q)+\mathcal{O}\left(x^{1-1/k}\right)$

We put these and (3) in (28) to get

$\displaystyle V(x,Q)$ $\displaystyle=$ $\displaystyle 2\sum_{q\leq
Q}\sum_{m<n\leq x\atop{n\equiv m(q)}}d_{k}(n)d_{k}(m)-xQP(\log x)+x^{2}P(\log
x,\log Q)+\mathcal{O}\left(x^{2-1/k}+Qx^{1-\mathfrak{d}}\right).\hskip
28.45274pt$ (30)

As said in the introduction, we now borrow from [7]. There are, for each
$1\leq a\leq q\leq\gamma$ with $(a,q)=1$, disjoint intervals
$\mathfrak{F}(a/q)$ about $a/q$ such that for any continuous
$f:\mathbb{R}\rightarrow\mathbb{C}$ of period 1

$\int_{0}^{1}f(t)dt=\sum_{q\leq\gamma}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\int_{\mathfrak{F}(a/q)}f(t)dt.$

The intervals satisfy

$\left(\frac{a}{q}-\frac{1}{2q\gamma},\frac{a}{q}+\frac{1}{2q\gamma}\right)\subseteq\mathfrak{F}(a/q)\subseteq\left(\frac{a}{q}-\frac{1}{q\gamma},\frac{a}{q}+\frac{1}{q\gamma}\right).$
(31)

This is the _Farey dissection_ of the unit interval of order $\gamma$ and for
its discussion see, for example, Section 3.8 of [10]. Defining for $X>0$,
$\alpha\in\mathbb{R}$

$S_{X}(\alpha)=\sum_{n\leq X}d_{k}(n)e(n\alpha)\hskip
28.45274pt\text{and}\hskip 28.45274ptF(\alpha)=\sum_{uv\leq x\atop{u\leq
Q}}e\left(uv\alpha\right)$

we see that

$\displaystyle\sum_{uv\leq x\atop{u\leq Q}}\sum_{m<n\leq
x\atop{n-m=uv}}d_{k}(n)d_{k}(m)=\sum_{q\leq\gamma}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\int_{\mathfrak{F}(a/q)}F(\alpha)|S_{x}(\alpha)|^{2}d\alpha=:\mathfrak{I}$
(32)

and as the LHS here is the $q,n,m$ sum in (30) we can say

$V(x,Q)=2\mathfrak{I}+xQ\underbrace{P(\log x)}_{\text{degree
}k^{2}-1}+x^{2}\underbrace{P(\log x,\log Q)}_{\text{degree }\leq
2k-1}+\mathcal{O}\left(x^{2-1/k}+Qx^{1-\mathfrak{d}}\right).$ (33)

Define

$F_{q}(\alpha)=\sum_{u\leq\sqrt{x}\atop{q|u}}\left(\sum_{v\leq
x/u}+\sum_{\sqrt{x}<v\leq Q,x/u}\right)e(uv\alpha)$

and write $\alpha=a/q+\beta$. From (3.1), (3.4), (3.5) and (3.6) of [7] and
from (31) we have $F(\alpha)=F_{q}(\alpha)+\mathcal{O}\left(\gamma\right)$ for
$\alpha\in\mathfrak{F}(a/q)$ and from (3.11) of [7] also

$\displaystyle F_{q}(\alpha)$ $\displaystyle\ll$
$\displaystyle\frac{x}{q(1+x|\beta|)}\hskip
28.45274pt|\beta|\leq\frac{1}{2q\sqrt{x}}$ $\displaystyle\ll$
$\displaystyle\gamma\hskip 28.45274pt\text{ for
}\alpha\in\mathfrak{F}(a/q)\char
92\relax\left(\frac{a}{q}-\frac{1}{2q\gamma},\frac{a}{q}+\frac{1}{2q\gamma}\right)$

so we can say222here and on note that $F_{q}(\beta)=0$ once $q>\sqrt{x}$

$\displaystyle\mathfrak{I}$ $\displaystyle=$
$\displaystyle\sum_{q=1}^{\infty}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\int_{\pm
1/2q\gamma}F_{q}(\beta)|S_{x}(\alpha)|^{2}d\beta+\mathcal{O}\left(x\gamma\right)$
(35)

and now we do some book-keeping before turning to this main term. Define

$\displaystyle\mathcal{M}_{X}(q)$ $\displaystyle\text{as in Lemma
\ref{kfold}}\hskip
42.67912ptg_{q}(t)=\frac{d}{dt}\\{t\mathcal{M}_{t}(q)\\}\hskip 42.67912pt$
$\displaystyle\Delta_{X}(a/q)$ $\displaystyle\text{as in Lemma
\ref{barbandavenporthalberstam}}\hskip
42.67912ptI_{q}(\beta)=\int_{1}^{x}e(\beta t)g_{q}(t)dt$

and write for $k>2$

$\sum_{\mathbf{h}|\mathbf{r}|q\atop{\mathbf{h}^{\prime}|\mathbf{r}^{\prime}|q}}=\sum_{r_{1}|\cdot\cdot\cdot|r_{k-2}|q\atop{r_{1}^{\prime}|\cdot\cdot\cdot|r_{k-2}^{\prime}|q\atop{h_{1}|r_{1},...,h_{k-2}|r_{k-2}\atop{h_{1}^{\prime}|r_{1}^{\prime},...,h_{k-2}^{\prime}|r_{k-2}^{\prime}}}}}\frac{\mu(h_{1})\cdot\cdot\cdot\mu(h^{\prime}_{k-2})}{h_{1}\cdot\cdot\cdot
h_{k-2}^{\prime}}$

and for $k=2$

$\sum_{\mathbf{h}|\mathbf{r}|q\atop{\mathbf{h}^{\prime}|\mathbf{r}^{\prime}|q}}P_{D,D^{\prime}}(q,\mathbf{r},\mathbf{r}^{\prime},\mathbf{h},\mathbf{h}^{\prime})=P_{D,D^{\prime}}(q).$

Note that there are polynomials $P_{D,D^{\prime}}(\cdot,...,\cdot)$ in
$\log(\cdot),...,\log(\cdot)$ of degree $\leq 2k-2-D-D^{\prime}$ such that

$\displaystyle g_{q}(t)g_{q}(t^{\prime})$ $\displaystyle=$
$\displaystyle\sum_{0\leq D,D^{\prime}\leq k-1}(\log t)^{D}(\log
t^{\prime})^{D^{\prime}}\sum_{\mathbf{h}|\mathbf{r}|q\atop{\mathbf{h}^{\prime}|\mathbf{r}^{\prime}|q}}P_{D,D^{\prime}}(q,\mathbf{r},\mathbf{r}^{\prime},\mathbf{h},\mathbf{h}^{\prime})$
(36) $\displaystyle=:$ $\displaystyle\sum_{0\leq D,D^{\prime}\leq k-1}(\log
t)^{D}(\log t^{\prime})^{D^{\prime}}\alpha_{\mathbf{D}}(q)$

and that for $t\leq x$

$\displaystyle I_{q}(\beta)\ll\frac{x}{1+x|\beta|}\hskip 22.76219ptg_{q}(t)\ll
1\hskip 22.76219ptg_{q}^{\prime}(t)\ll\frac{1}{t}.$ (37)

From Lemma 2 and the Cauchy-Schwarz inequality

$\displaystyle\sum_{q\leq\sqrt{x}}\frac{1}{q^{2}}\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\max_{t\leq
x}|\Delta_{t}(a/q)|\ll\sqrt{x}+\underbrace{x^{1-4/(6k-3)}}_{k>2}$ (38)

and

$\displaystyle\sum_{q\leq\sqrt{x}}\frac{1}{q}\left(1+\frac{x}{q\gamma}\right)\sideset{}{{}^{\prime}}{\sum}_{a=1}^{q}\max_{t\leq
x}|\Delta_{t}(a/q)|^{2}\ll
x^{3/2}+\underbrace{x^{2-1/k}+\frac{x^{3-8/(6k-3)}}{\gamma}}_{k>2}.$ (39)

Now back to (35). Partial summation, integration by parts and (37) give

$\displaystyle S_{x}(\alpha)$ $\displaystyle=$ $\displaystyle
e(x\beta)S_{x}(a/q)-2\pi i\beta\int_{1}^{x}e(t\beta)S_{t}(a/q)dt$
$\displaystyle=$ $\displaystyle\underbrace{\frac{I_{q}(\beta)}{q}}_{\ll
x/q(1+|\beta|x)}+\underbrace{e(x\beta)\Delta_{x}(a/q)-2\pi
i\beta\int_{1}^{x}e(t\beta)\Delta_{t}(a/q)dt}_{=:J(\alpha)\ll(1+|\beta|x)\max_{t\leq
x}|\Delta_{t}(a/q)|}+\mathcal{O}(1)$

so

$\displaystyle|S_{x}(\alpha)|^{2}$ $\displaystyle=$
$\displaystyle\frac{|I_{q}(\beta)|^{2}}{q^{2}}+\mathcal{O}\left(\frac{x\max_{t\leq
x}|\Delta_{t}(a/q)|}{q}+|J(\alpha)|^{2}+1\right).$ (40)

With (A Montgomery-Hooley theorem for the $k$-fold divisor function) we have

$\displaystyle\int_{\pm 1/2q\gamma}F_{q}(\beta)|J(\alpha)|^{2}d\beta$
$\displaystyle\ll$ $\displaystyle\frac{|\Delta_{x}(a/q)|^{2}}{q}\int_{\pm
1/q\gamma}\frac{xd\beta}{1+x|\beta|}+\frac{1}{q}\int_{1}^{x}\int_{1}^{x}\Delta_{t}(a/q)\overline{\Delta_{t^{\prime}}(a/q)}\int_{\pm
1/q\gamma}\beta e\left(\beta(t-t^{\prime})\right)dt^{\prime}dt$
$\displaystyle\ll$
$\displaystyle\frac{1}{q}\left(1+\frac{x}{q\gamma}\right)\max_{t\leq
x}|\Delta_{t}(a/q)|^{2}$

so from (40), (A Montgomery-Hooley theorem for the $k$-fold divisor function),
(38) and (39) the main term in (35) is

$\displaystyle\sum_{q=1}^{\infty}\frac{\phi(q)}{q^{2}}\int_{\pm
1/2q\gamma}F_{q}(\beta)|I_{q}(\beta)|^{2}d\beta+\mathcal{O}\left(x^{3/2}+\underbrace{x^{2-4/(6k-3)}+\frac{x^{3-8/(6k-3)}}{\gamma}}_{k>2}\right).$

From (37) and $F_{q}(\beta)\ll x/q$ the integral here may be extended to
infinity at the cost of an error $\ll x\gamma$ and we conclude

$\displaystyle\mathfrak{I}$ $\displaystyle=$
$\displaystyle\underbrace{\sum_{q=1}^{\infty}\frac{\phi(q)}{q^{2}}\int_{\pm\infty}F_{q}(\beta)|I_{q}(\beta)|^{2}d\beta}_{=:\mathfrak{M}}+\mathcal{O}\left(x^{3/2}+\underbrace{x^{2-4/(6k-3)}}_{k>2}\right).$
(41)

Let

$\displaystyle L(Z)$ $\displaystyle=$
$\displaystyle\int_{1,1+Z}^{x,x+Z}g_{q}(t)g_{q}(t-Z)dt$

so that $|I_{q}(\beta)|^{2}=\hat{L}(\beta)$ and therefore

$\displaystyle\int_{\pm\infty}e(-uv\beta)|I_{q}(\beta)|^{2}d\beta=L(uv)$

so

$\displaystyle\mathfrak{M}$ $\displaystyle=$
$\displaystyle\sum_{q=1}^{\infty}\frac{\phi(q)}{q^{2}}\sum_{u\leq\sqrt{x}\atop{q|u}}\int_{1+u}^{x}g_{q}(t)\left(\sum_{v\leq(t-1)/u}+\sum_{\sqrt{x}<v\leq
Q,(t-1)/u}\right)g_{q}(t-uv)dt$ (42) $\displaystyle=:$
$\displaystyle\sum_{q=1}^{\infty}\frac{\phi(q)}{q^{2}}\sum_{u\leq\sqrt{x}\atop{q|u}}\int_{1+u}^{x}g_{q}(t)V_{u}(t).\hskip
28.45274pt$

Write

$G_{q}(X)=\int_{1}^{X}g_{q}(t)dt$

and bear (37) in mind. For any $0\leq A<B\leq(t-1)/u$ the Euler-Maclaurin
summation formula says that

$\displaystyle\sum_{A<v\leq
B}g_{q}(t-uv)=\frac{G_{q}(t-uA)-G_{q}(t-uB)}{u}+\mathcal{O}(1)$

so the first sum in $V_{u}(t)$ is

$G_{q}(t)/u+\mathcal{O}(1)$

and the second sum vanishes for $(t-1)/u<\sqrt{x}$ whilst for
$(t-1)/u\geq\sqrt{x}$ it’s

$\displaystyle\frac{G_{q}\left(t-u\sqrt{x}\right)}{u}-\frac{1}{u}\left\\{\begin{array}[]{ll}0&\text{
if }(t-1)/u\leq Q\\\ G_{q}(t-uQ)&\text{ if
}(t-1)/u>Q\end{array}\right\\}+\mathcal{O}\left(1\right)$

so (42) becomes

$\displaystyle\mathfrak{M}$ $\displaystyle=$
$\displaystyle\sum_{q=1}^{\infty}\frac{\phi(q)}{q^{3}}\left(\sum_{u\leq\sqrt{x}/q}\frac{1}{u}\right)\int_{1}^{x}g_{q}(t)G_{q}(t)dt+\\{\text{
term $Q=\sqrt{x}$ }\\}$ (44) $\displaystyle-\hskip
11.38109pt\int_{1+Q}^{x}g_{q}(t)\left(\sum_{u\leq(t-1)/Q}\frac{1}{u}\sum_{q|u}\frac{\phi(q)}{q^{2}}G_{q}(t-uQ)\right)dt+\mathcal{O}\left(x^{3/2}\right)$
$\displaystyle=:$
$\displaystyle\mathcal{A}(x)+\mathcal{B}(\sqrt{x})-\mathcal{B}(Q)+\mathcal{O}\left(x^{3/2}\right).$

From (36) the integrand in $\mathcal{B}(Q)$ is

$\displaystyle\sum_{0\leq D,D^{\prime}\leq k-1}(\log
t)^{D}\sum_{u\leq(t-1)/Q}\frac{1}{u}\underbrace{\left(\sum_{q|u}\frac{\phi(q)\alpha_{\mathbf{D}}(q)}{q^{2}}\right)}_{=:\Phi_{\mathbf{D}}(u)}\int_{1}^{t-uQ}(\log
t^{\prime})^{D^{\prime}}dt^{\prime}$

so from Lemma 4 for any $c>0$

$\displaystyle\mathcal{B}(Q)$ $\displaystyle=$ $\displaystyle\sum_{0\leq
D,D^{\prime}\leq
k-1}\int_{c\pm\infty}\frac{\mathcal{F}_{\mathbf{D}}(s)}{Q^{s}}\left(\int_{1}^{x}(\log
t)^{D}K_{t}(s)dt\right)ds+\mathcal{O}\left(Q^{2}\right)\hskip 28.45274pt$ (45)

where

$\displaystyle\mathcal{F}_{\mathbf{D}}(s)$ $\displaystyle=$
$\displaystyle\sum_{u=1}^{\infty}\frac{\Phi_{\mathbf{D}}(u)}{u^{s+1}}$

and where $K_{t}(s)$ satisfies

$\displaystyle\int_{1}^{x}(\log t)^{D}K_{t}(s)dt$ $\displaystyle\ll$
$\displaystyle\frac{x^{\sigma+2}}{|s(s+1)(s+2)|}$

amd is holomorphic for $\sigma>-2$ except for simple poles at $s=-1,0$ where
it has Laurent expansions

$\displaystyle\frac{K_{t}(s)}{Q^{s}}$ $\displaystyle=$
$\displaystyle\frac{t}{s}\sum_{n\geq 0}P_{n}(t,Q)s^{n}\hskip
28.45274pt\text{about }s=0$ $\displaystyle\frac{K_{t}(s)}{Q^{s}}$
$\displaystyle=$ $\displaystyle\frac{Q}{s+1}\sum_{n\geq
0}P_{n}(t,Q)(s+1)^{n}\hskip 28.45274pt\text{about }s=-1$

for some polynomials in $\log t,\log Q$ of degree $D^{\prime}+n$. Recall the
definitions in the sentence containing (36) and write $Z=k(k-2)$. From Lemma 6
there are $\lambda_{\mathbf{k}}(s)$ holomorphic and $\ll 1$ for $\sigma>-3/2$
such that for $s>-1$

$\displaystyle\mathcal{F}_{\mathbf{D}}(s)$ $\displaystyle=$
$\displaystyle\zeta(s+1)\sum_{q=1}^{\infty}\frac{\phi(q)}{q^{s+3}}\sum_{r_{1}|\cdot\cdot\cdot|r_{k-2}|q\atop{r_{1}^{\prime}|\cdot\cdot\cdot|r_{k-2}^{\prime}|q\atop{h_{1}|r_{1},...,h_{k-2}|r_{k-2}\atop{h_{1}^{\prime}|r_{1}^{\prime},...,h_{k-2}^{\prime}|r_{k-2}^{\prime}}}}}\frac{\mu(h_{1})\cdot\cdot\cdot\mu(h_{k-2}^{\prime})}{h_{1}\cdot\cdot\cdot
h_{k-2}^{\prime}}\underbrace{P_{\mathbf{D}}(q,\mathbf{r},\mathbf{r}^{\prime},\mathbf{h},\mathbf{h}^{\prime})}_{\text{degree
}\leq 2k-2-D-D^{\prime}=:d}$ $\displaystyle=$
$\displaystyle\zeta(s+1)\sum_{k_{i}\geq 0\atop{k_{0}+\cdot\cdot\cdot+k_{Z}\leq
d}}\lambda_{\mathbf{k}}(s)\zeta^{(k_{1})}(s+2)\cdot\cdot\cdot\zeta^{(k_{Z})}(s+2)$
$\displaystyle=:$ $\displaystyle\zeta(s+1)\lambda(s)$ $\displaystyle\ll_{k}$
$\displaystyle|\zeta(s+1)|\max_{0\leq n\leq d}|\zeta^{(n)}(s+2)|^{Z}$

so the integral in (45) may be moved to $\mathfrak{c}-2$, where $\mathfrak{c}$
is as in Theorem 1, where it is bounded by

$\displaystyle\frac{x^{\mathfrak{c}}}{Q^{\mathfrak{c}-2}}\int_{\mathfrak{c}-2\pm\infty}\frac{|\zeta^{(n)}(s+2)|^{k(k-2)}ds}{(1+t)^{3/2+\mathfrak{c}}}\ll
Q^{2}\left(\frac{x}{Q}\right)^{\mathfrak{c}},$

picking up residues

$\displaystyle\Big{(}Res_{s=0}+Res_{s=-1}\Big{)}\Bigg{\\{}\frac{\zeta(s+1)\lambda(s)}{Q^{s}}\int_{1}^{x}(\log
t)^{D}K_{t}(s)dt\Bigg{\\}}.$

From the above Laurent expansions the first residue is

$\displaystyle\Big{(}x^{2}+\mathcal{O}(1)\Big{)}Res_{s=0}\Bigg{\\{}\frac{\zeta(s+1)\lambda(s)}{s}\sum_{n\geq
0}s^{n}\underbrace{P_{n}(x,Q)}_{\text{degree }\leq n+D+D^{\prime}}\Bigg{\\}}$

and the second is

$\displaystyle
Q\Big{(}x+\mathcal{O}(1)\Big{)}Res_{s=-1}\Bigg{\\{}\frac{\zeta(s+1)}{s+1}\left(\frac{1}{(s+1)^{Z+d}}\sum_{k_{i}\geq
0\atop{k_{0}+\cdot\cdot\cdot+k_{Z}=d}}\lambda_{\mathbf{k}}(s)+\cdot\cdot\cdot\right)\sum_{n\geq
0}(s+1)^{n}\underbrace{P_{n}(x,Q)}_{\text{degree }\leq
n+D+D^{\prime}}\Bigg{\\}}$

so the sum of these residues is
$x^{2}P(x,Q)+xQP(x,Q)+\mathcal{O}\left(Q\right)$ for some polynomials in $\log
x,\log Q$ of degrees $\leq 1+D+D^{\prime}$ and $\leq Z+d+D+D^{\prime}$
respectively and (45) becomes

$\mathcal{B}(Q)=x^{2}P(x,Q)+xQP(x,Q)+\mathcal{O}\left(Q^{2}\left(\frac{x}{Q}\right)^{\mathfrak{c}}\right)$

for some polynomials of degree $\leq 2k-1$ and $\leq k^{2}-1$. Meanwhile it is
clear that the quantity $\mathcal{A}(x)$ in (44) is $x^{2}P(x,Q)$ for some
polynomial of degree $\leq 2k-1$ so putting all this in (44) we get Theorem 1
from (33) and (41), with Theorem 2 telling us there can be no $x^{2}$ term.

## References

  * [1] W.D. Banks, R. Heath-Brown and I.E. Shparlinski - _On the average value of divisor sums in arithmetic progressions_ \- International Mathematics Research Notices, 1 (2005)
  * [2] V. Blomer - _The average value of divisor sums in arithmetic progressions_ \- The Quarterly Journal of Mathematics, 59 (2008)
  * [3] R. de la Bretèche , D. Fiorilli - _Major arcs and moments of arithmetical sequences_ \- American Journal of Mathematics, 142 (2020)
  * [4] J. Brüdern and R. C. Vaughan - _A Montgomery-Hooley theorem for sums of two cubes_ \- European Journal of Mathematics (2021)
  * [5] E. Fouvry - _Autour du théorème de Bombieri-Vinogradov_ \- Acta Mathematica 152 (1984)
  * [6] R. Heath-Brown - _The divisor function $d_{3}(n)$ in arithmetic progressions_ \- Acta Arithmetica, XLVII (1986)
  * [7] D. A. Goldston and R. C. Vaughan - _On the Montgomery–Hooley asymptotic formula; in Sieve Methods, Exponential Sums and Their Applications in Number Theory_ \- Cambridge University Press (1997)
  * [8] J. Keating, B. Rodgers, E. Roditty-Gershon and Z. Rudnick - _Sums of divisor functions in $F_{q}[t]$ and matrix integrals_ \- Mathematische Zeitschrift, 288 (2018)
  * [9] Y.-K. Lau and L. Zhao - _On a variance of Hecke eigenvalues in arithmetic progressions_ \- Journal of Number Theory, 132 (2012)
  * [10] G. H. Hardy and E.M. Wright - _The theory of numbers_ (3rd edition) - Claredon Press (1954)
  * [11] Y. Motohashi - _On the distribution of the divisor function in arithmetic progressions_ \- Acta Arithmetica XXII (1973)
  * [12] D. Nguyen - _Variance of the k-fold divisor function in arithmetic progressions for individual modulus_ \- arXiv
  * [13] D. Nguyen - _Generalized divisor functions in arithmetic progressions: II_ \-
https://web.math.ucsb.edu/ dnguyen/preprints/DivisorFunctionsInAPII.pdf

  * [14] P. Pongsriiam - _The distribution of the divisor function in arithmetic progressions_ \- Ph.D. thesis, Pennsylvania State University (2012)
  * [15] P. Pongsriiam and R.C. Vaughan - _The divisor function on residue classes I_ \- Acta Arithmetica, 168 (2015)
  * [16] P. Pongsriiam and R.C. Vaughan - _The divisor function on residue classes II_ \- Acta Arithmetica, 182 (2018)
  * [17] B. Rodgers and K. Soundararajan - _The variance of divisor sums in arithmetic progressions_ \- Forum Mathematicum 30 (2018)
  * [18] E. C. Titchmarsh - _The theory of the Riemann zeta function_ (2nd edition) - Claredon Press, Oxford (1986)
  * [19] R.C. Vaughan - _Generalized Montgomery-Hooley formula; A survey_ \-
http://www.personal.psu.edu/rcv4/MontgomeryHooley.pdf

_e-mail address_ \-<EMAIL_ADDRESS>