1 Introduction and Statement of Results

Let \(\gcd (k,j)\) be the greatest common divisor of the integers k and j. The gcd-sum function, which is also known as Pillai’s arithmetical function, is defined by

$$\begin{aligned} P(n)=\sum _{k=1}^{n}\gcd (k,n). \end{aligned}$$

This function has been studied by many authors such as Broughan [4], Bordellés [3],Tanigawa and Zhai [18], Tóth [19], and others. Analytic properties for partial sums of the gcd-sum function \(f(\gcd (j,k))\) were recently studied by Inoue and Kiuchi [8]. We recall that the symbol \(*\) denotes the Dirichlet convolution of two arithmetical functions f and g defined by \(f * g(n) = \sum _{d \mid n} f(d) g(n / d)\), for every positive integer n. For any arithmetical function f, the second author [11] showed, that for any fixed positive integer r and any large positive number \(x \ge 2\) we have

$$\begin{aligned} M_r(x;f)&:= \sum _{k\le x} \frac{1}{k^{r+1}}\sum _{j=1}^{k}j^{r}f(\gcd (k,j)) \nonumber \\&=\frac{1}{2} \sum _{n\le x}\frac{f(n)}{n} + \frac{1}{r+1}\sum _{d\ell \le x}\frac{\mu *f(d)}{d} \nonumber \\&\quad + \frac{1}{r+1} \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \sum _{d\ell \le x}\frac{\mu *f(d)}{d} \frac{1}{\ell ^{2m}}. \end{aligned}$$
(1)

Here, as usual, the function \(\mu \) denotes the Möbius function and \(B_m = B_m(0)\) are the Bernoulli numbers, with \(B_{m}(x)\) being the Bernoulli polynomials defined by the generating function

$$\begin{aligned} \displaystyle \frac{ze^{xz}}{e^{z}-1}=\sum _{m=0}^{\infty }B_{m}(x)\frac{z^m}{m!} \end{aligned}$$

with \(|z|< 2\pi \). Many applications of Eq. (1) have been given in [10, 12] and [13].

In [11], Eq. (1) was used to establish asymptotic formulas for \(M_r(x;f)\) for specific choices of f such as the identity function \(\mathrm{id}\), the Euler totient function \(\phi =\mathrm{id}*\mu \) or the Dedekind function \(\psi =\mathrm{id}*|\mu |\). More precisely, let \(\zeta (s)\) denote the Riemann zeta-function, then for \(f = \mathrm{id}\), it was proved that

$$\begin{aligned} M_{r}(x;\mathrm{id})= & {} \frac{1}{(r+1)\zeta (2)} x\log x + \frac{x}{2} \\&+ \frac{1}{(r+1)\zeta (2)}\left( 2\gamma -1 - \frac{\zeta '(2)}{\zeta (2)} + \sum _{m=1}^{[r/2]}\left( {\begin{array}{c}r+1\\ 2m\end{array}}\right) B_{2m} \zeta (2m+1) \right) \\&x + K_{r}(x), \end{aligned}$$

where

$$\begin{aligned} K_{r}(x) = \frac{1}{r+1} \sum _{n\le x}\frac{\mu (n)}{n}\Delta \left( \frac{x}{n}\right) + O_{r}\left( \log x\right) . \end{aligned}$$
(2)

For \(f = \phi \), it was shown that

$$\begin{aligned} M_{r}(x;\phi )= & {} \frac{1}{(r+1)\zeta ^{2}(2)}x \log x + \frac{x}{2\zeta (2)} \\&+ \frac{1}{(r+1)\zeta ^{2}(2)}\left( 2\gamma -1 -2\frac{\zeta '(2)}{\zeta (2)} + \sum _{m=1}^{[r/2]}\left( {\begin{array}{c}r+1\\ 2m\end{array}}\right) B_{2m} \zeta (2m+1)\right) \\&x + L_{r}(x), \end{aligned}$$

where

$$\begin{aligned} L_{r}(x) := \frac{1}{r+1}\sum _{n\le x}\frac{\mu *\mu (n)}{n}\Delta \left( \frac{x}{n}\right) + O_{r}\left( (\log x)^2\right) . \end{aligned}$$
(3)

Lastly, for \(f = \psi \) it was proved that

$$\begin{aligned}&M_{r}(x;\psi ) = \frac{1}{(r+1)\zeta ^{}(4)} x\log x + \frac{\zeta (2)}{2\zeta (4)} x \\&\quad + \frac{1}{(r+1)\zeta (4)} \left( 2\gamma - 1 - 2 \frac{\zeta '(4)}{\zeta (4)}+ \sum _{m=1}^{[r/2]}\left( {\begin{array}{c}r+1\\ 2m\end{array}}\right) B_{2m} \zeta (2m+1) \right) x + U_{r}(x), \end{aligned}$$

where

$$\begin{aligned} U_{r}(x) := \frac{1}{r+1} \sum _{n\le x} \frac{\mu *|\mu |(n)}{n}\Delta \left( \frac{x}{n}\right) + O_{r}\left( (\log x)^{2}\right) . \end{aligned}$$
(4)

The function \(\Delta (x)\) denotes the error term of the Dirichlet divisor problem: Let \(\tau = \mathbf{1}*\mathbf{1}\) be the divisor function, then for any large positive number \(x \ge 2\),

$$\begin{aligned} \sum _{n\le x}\tau (n)&= x\log x + (2\gamma -1)x + \Delta (x), \end{aligned}$$
(5)

where \(\gamma \) is the Euler constant and \(\Delta (x)\) can be estimated by \(\Delta (x) = O\left( x^{\theta + \varepsilon }\right) \). It is known that one can take \(1/4\le \theta \le 1/3\). More precisely, the Dirichlet divisor problem is to find the smallest value of \(\theta \) for which the above estimate holds, for any \(\epsilon >0.\) This problem is still unsolved. The best estimate to date is

$$\begin{aligned} O\left( x^{131/416}(\log x)^{26947/8320}\right) , \end{aligned}$$

obtained by Huxley [7] in 2003.

The first purpose of this paper is to refine the error terms \(K_r(x), L_r(x)\) and \(U_r(x)\) from the above formulas. Therefore, let \(\sigma _{u} = \mathrm{id}_{u}*\mathbf{1}\) be the generalized divisor function for any real number u and let \(m\ge 1\) be an integer. Then for any large positive number \(x\ge 2\), the function \(\Delta _{-2m}(x)\) denotes the error term of the generalized divisor problem given by

$$\begin{aligned} \sum _{n\le x}\sigma _{-2m}(n)&= \zeta (1+2m)x - \frac{1}{2}\zeta (2m) + \Delta _{-2m}\left( x\right) . \end{aligned}$$
(6)

For more details about the functions \(\Delta (x), \Delta _{-2m}(x)\), see [1]. We have the following results:

Theorem 1

Let \(\Delta (x)\) and \(\Delta _{-2m}(x)\) be the error terms given by Eqs. (5) and (6), respectively. For any large positive number \(x > 5\) and fixed positive integer r, we have

$$\begin{aligned} K_r(x)&= \frac{1}{r+1} \sum _{d\le x} \frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) \\&\quad + \frac{1}{r+1}\sum _{d\le x} \frac{\mu (d)}{d} \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \Delta _{-2m}\left( \frac{x}{d}\right) + O_{r}\left( \delta (x)\right) , \end{aligned}$$

where the function \(\delta (x)\) is defined by

$$\begin{aligned} \delta (x) := \mathrm{{exp}}\left( -C\frac{(\log x)^{3/5}}{(\log \log x)^{1/5}}\right) \end{aligned}$$
(7)

with C being a positive constant. Moreover, we have

$$\begin{aligned} L_r(x)&= \frac{1}{r+1} \sum _{n\le x} \frac{\mu *\mu (n)}{n}\Delta \left( \frac{x}{n}\right) \\&\quad + \frac{1}{r+1} \sum _{n\le x} \frac{\mu *\mu (n)}{n}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m}B_{2m}\Delta _{-2m}\left( \frac{x}{n}\right) \\&\quad + O_{r}\left( (\log x)^{2/3}(\log \log x)^{1/3}\right) . \end{aligned}$$

and

$$\begin{aligned} U_r(x)&= \frac{1}{r+1} \sum _{n\le x} \frac{\mu *|\mu |(n)}{n}\Delta \left( \frac{x}{n}\right) \\&\quad + \frac{1}{r+1} \sum _{n\le x} \frac{\mu *|\mu |(n)}{n}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m}B_{2m}\Delta _{-2m}\left( \frac{x}{n}\right) \\&\quad - \frac{1}{4\zeta (2)}\log x + O_{r}\left( (\log x)^{2/3}\right) . \end{aligned}$$

Remark 1

It is easily checked that using the weakest estimate \(\Delta _{-2m}(x)=O_{m}(1)\) in the results Theorem 1 yields much better results than the previously known formulas for \(K_r(x)\), \(L_r(x)\) and \(M_r(x)\) from Eqs. (2), (3), and (4).

Furthermore, even better estimates of \(K_r(x)\) can be achieved by additional assumptions on the Riemann zeta-function. Under the Riemann Hypothesis, Maier and Montgomery [15] gave a sharper estimate of the partial sum of the Möbius function, which was later improved by Soundararajan [17]. The author proved that

$$\begin{aligned} M(x) := \sum _{n\le x}\mu (n) = O\left( {x^{1/2}}{\eta (x)}\right) \end{aligned}$$

where

$$\begin{aligned} \eta (x) := \mathrm{exp}\left( (\log x)^{1/2}(\log \log x)^{14}\right) , \end{aligned}$$
(8)

for any large positive number \(x> 5\) satisfying \(x=[x]+\frac{1}{2}\). This latter has been improved slightly by Balazard and de Roton [2]. By using the above result on M(x), we obtain the next statement.

Theorem 2

Assume the Riemann Hypothesis and let \(\Delta (x)\) and \(\Delta _{-2m}(x)\) be the error terms given by Eqs. (5) and (6), respectively. Then for any large positive number \(x > 5\) such that \(x=[x]+\frac{1}{2}\) and fixed positive integer r, we have

$$\begin{aligned} K_r(x)&= \frac{1}{r+1} \sum _{d\le x} \frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) \\&\quad + \frac{1}{r+1} \sum _{d\le x} \frac{\mu (d)}{d}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \Delta _{-2m}\left( \frac{x}{d}\right) + O_{r}\left( \frac{ \eta (x) \log x}{x^{1/2}} \right) . \end{aligned}$$

For our further considerations, let \(\rho =\alpha +i\beta \) denote the generic non-trivial zeros of the Riemann zeta-function. Under the assumption that all zeros \(\rho \) in the critical strip of \(\zeta (s)\) are simple, we are able to prove an additional refinement for the error term \(K_r(x)\).

Theorem 3

Assume that the zeros of \(\zeta (s)\) are simple. Let \(T_{*}\ge x^{6}\) be some positive number satisfying the inequality

$$\begin{aligned} \frac{1}{\zeta (\sigma +iT_{*})} \ll T_{*}^{\varepsilon } \end{aligned}$$

for \(\frac{1}{2} \le \sigma \le 2\). For any large positive number \(x> 5\) with \(x=[x]+\frac{1}{2}\) we then have

$$\begin{aligned} K_r(x)&= \frac{1}{r+1}\sum _{n\le x}\frac{\mu (n)}{n}\Delta \left( \frac{x}{n}\right) + \frac{1}{r+1}\sum _{n\le x}\frac{\mu (n)}{n}\sum _{m=1}^{[r/2]} {r+1 \atopwithdelims ()2m} B_{2m} \Delta _{-2m}\left( \frac{x}{n}\right) \\&\quad + \frac{2\gamma + C_{\mathrm{{odd}}}(r) -1 }{r+1}\sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -2)\zeta '(\rho )} - \frac{C_{\mathrm{{even}}}(r)}{2(r+1)} \sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -1)\zeta '(\rho )} \\&\quad + \frac{1}{r+1}\sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -2)^2 \zeta '(\rho )} + O_{r}\left( x^{-3}\right) , \end{aligned}$$

where the functions \(C_{\mathrm{{odd}}}(r)\) and \( C_{\mathrm{{even}}}(r)\) are given by

$$\begin{aligned} C_{\mathrm{{odd}}}(r) := \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \zeta (2m+1), \end{aligned}$$

and

$$\begin{aligned} C_{\mathrm{{even}}}(r) := \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \zeta (2m) \end{aligned}$$

for any fixed positive integer r.

Finally, define the sum

$$\begin{aligned} J_{-\lambda }(T) := \sum _{0 < \beta \le T} \frac{1}{|\zeta '(\rho )|^{2\lambda }} \end{aligned}$$

which is intimately connected to Mertens function. Assuming the simplicity of the zeros of \(\zeta (s)\), Gonek [5] and Hejhal [6] independently conjectured that for any real number \(\lambda < 3/2\), we have

$$\begin{aligned} J_{-\lambda }(T)&\asymp T(\log {T})^{(\lambda -1)^2} \end{aligned}$$
(9)

We use this conjecture to prove the following:

Theorem 4

Assume that the Riemann Hypothesis and Gonek-Hejhal conjecture. Then

$$\begin{aligned} K_r(x)&= \frac{1}{r+1}\sum _{n\le x}\frac{\mu (n)}{n}\Delta \left( \frac{x}{n}\right) + \frac{1}{r+1}\sum _{d\le x}\frac{\mu (d)}{d}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m}\Delta _{-2m}\left( \frac{x}{d}\right) \\&\quad + O_{r}\left( \frac{(\log x)^{5/4}}{x^{1/2}}\right) , \end{aligned}$$

for any large positive number \(x> 5\) satisfying \(x=[x]+\frac{1}{2}\).

2 Proofs of Theorems 1 and 2

In order to prove our main results, we first show some necessary lemmas.

2.1 Auxiliary Lemmas

Lemma 1

For any large positive number \(x > 5\), we have

$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n^2}&= \frac{1}{\zeta (2)} + O\left( \frac{\delta (x)}{x}\right) , \end{aligned}$$
(10)
$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n^2} \log n&= \frac{\zeta '(2)}{\zeta ^{2}(2)}+ O\left( \frac{\delta (x)}{x}\right) , \end{aligned}$$
(11)

and

$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n}&= O\left( \delta (x)\right) , \end{aligned}$$
(12)

where \(\delta (x)\) is given by Eq. (7). Assume that \(x=[x]+\frac{1}{2}\). Under the Riemann Hypothesis we have

$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n^2}&= \frac{1}{\zeta (2)} + O\left( \frac{\eta (x)}{x^{3/2}}\right) , \end{aligned}$$
(13)
$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n^2} \log n&= \frac{\zeta '(2)}{\zeta ^{2}(2)}+ O\left( \frac{\eta (x)\log x}{x^{3/2}}\right) , \end{aligned}$$
(14)

and

$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n}&= O\left( \frac{\eta (x)}{x^{1/2}}\right) . \end{aligned}$$
(15)

for any large positive number \(x > 5\). Here \(\eta (x)\) is given by Eq. (8).

Proof

Eqs. (10) and (11) follow from Lemmas 2.2 and 2.3 in [16]. The proof of Eq. (12) can be found in [9]. The formulas (13)–(15) follow from Lemma 2.1 in [8]. \(\square \)

Lemma 2

For any large positive number \(x > 5\), we have

$$\begin{aligned} \sum _{n\le x}\frac{\phi (n)}{n}&= \frac{x}{\zeta (2)} + O\left( (\log x)^{2/3}(\log \log x)^{1/3}\right) . \end{aligned}$$

Proof

For any large positive number \(x\ge 5\), we use the result of Liu in [14]

$$\begin{aligned} \sum _{\ell \le x}\frac{\mu (\ell )}{\ell }\vartheta \left( \frac{x}{\ell }\right) = O\left( (\log x)^{2/3}(\log \log x)^{1/3}\right) , \end{aligned}$$

the fact that \( \phi =\mathrm{id}*\mu \), and Eqs. (10), (12) to obtain the formula

$$\begin{aligned} \sum _{n\le x}\frac{\phi (n)}{n}&= \sum _{\ell \le x}\frac{\mu (\ell )}{\ell }\left( \frac{x}{\ell }- \vartheta \left( \frac{x}{\ell }\right) -\frac{1}{2}\right) \\&= \frac{x}{\zeta (2)} + O\left( (\log x)^{2/3}(\log \log x)^{1/3}\right) . \end{aligned}$$

Here \(\vartheta (x)\) is the oscillatory function defined by \(x-[x]-\frac{1}{2}\). This completes the proof. \(\square \)

Lemma 3

For any large positive number \(x > 5\), we have

$$\begin{aligned} \sum _{n\le x}\frac{\psi (n)}{n}&=\frac{\zeta (2)}{\zeta (4)}x - \frac{1}{2\zeta (2)}\log x + O\left( (\log x)^{2/3}\right) . \end{aligned}$$

Proof

The proof can be found in [20, Satz 3]. \(\square \)

Lemma 4

For any large positive number \(x > 5\), we have

$$\begin{aligned} \sum _{n\le x}\frac{\mu *\mu (n)}{n^2}&= \frac{1}{\zeta ^{2}(2)} + O\left( \frac{\kappa (x)}{x}\right) , \end{aligned}$$
(16)
$$\begin{aligned} \sum _{n\le x}\frac{\mu *\mu (n)}{n^2} \log n&= 2\frac{\zeta '(2)}{\zeta ^{3}(2)}+ O\left( \frac{\kappa (x)}{x}\right) , \end{aligned}$$
(17)

and

$$\begin{aligned} \sum _{n\le x}\frac{\mu *\mu (n)}{n}&= O_{}\left( \kappa (x)\right) , \end{aligned}$$
(18)

where \(\kappa (x)\) is given by

$$\begin{aligned} \kappa (x)=\exp \left( -D(\log x\log \log x)^{1/3} \right) \end{aligned}$$

with D being a positive constant.

Proof

Eqs. (16), (17) and (18) follow from Eqs. (3.5), (3.6) and (3.3) in [8], respectively. \(\square \)

Lemma 5

For any large positive number \(x > 5\), we have

$$\begin{aligned} \sum _{n\le x}\frac{|\mu |*\mu (n)}{n^2}&= \frac{1}{\zeta ^{}(4)} + O\left( \frac{\delta (x)}{x^{3/2}}\right) , \end{aligned}$$
(19)
$$\begin{aligned} \sum _{n\le x}\frac{|\mu |*\mu (n)}{n^2} \log n&= 2\frac{\zeta '(4)}{\zeta ^{2}(4)}+ O\left( \frac{\delta (x)}{x^{3/2}}\right) , \end{aligned}$$
(20)

and

$$\begin{aligned} \sum _{n\le x}\frac{|\mu |*\mu (n)}{n}&= \frac{1}{\zeta (2)} +O_{}\left( \frac{\delta (x)}{x^{1/2}}\right) . \end{aligned}$$
(21)

Proof

Eqs. (19) and (20) follow from Eqs. (3.7) and (3.8) in [8], respectively. It is known that

$$\begin{aligned} \sum _{n=1}^{\infty }\frac{|\mu |*\mu (n)}{n}= \frac{1}{\zeta (2)}, \end{aligned}$$

Now, we write our sums as follows

$$\begin{aligned} \sum _{n\le x}\frac{|\mu |*\mu (n)}{n}&=\sum _{n=1}^{\infty }\frac{|\mu |*\mu (n)}{n}-\sum _{n> x}\frac{|\mu |*\mu (n)}{n}\\&= \frac{1}{\zeta (2)}-\sum _{n >x}\frac{|\mu |*\mu (n)}{n}. \end{aligned}$$

To complete the proof, it remains to estimate the last sum above. Notice that

$$\begin{aligned} \sum _{n> x}\frac{|\mu |*\mu (n)}{n}=\int _ {x}^{\infty }\frac{\sum _{x<n\le t}|\mu |*\mu (n)}{t^2}\, dt \end{aligned}$$

and that

$$\begin{aligned} \sum _{n\le x}|\mu |*\mu (n) = \sum _{n\le \sqrt{x}}\mu (n)+O\left( x^{\epsilon }\right) = O\left( x^{1/2}\delta (x)\right) , \end{aligned}$$

where we used Eq. (3.4) from [8]. Therefore, we have

$$\begin{aligned} \sum _{n> x}\frac{|\mu |*\mu (n)}{n}= O\left( \int _{x}^{\infty } \frac{t^{1/2} \delta (t)}{t^2}\, dt \right) = O\left( \frac{\delta (x)}{x^{1/2}}\right) , \end{aligned}$$

and Eq. (21) is proved. \(\square \)

Lemma 6

For any large positive number \(x> 5\), we have

$$\begin{aligned} \sum _{n\le x}\sum _{d|n}\frac{\phi (d)}{d}&= \frac{1}{\zeta (2)}x\log x + \frac{1}{\zeta (2)}\left( 2\gamma -1 - \frac{\zeta '(2)}{\zeta (2)}\right) x \nonumber \\&\quad + \sum _{d\le x}\frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) + O\left( \delta (x)\right) , \end{aligned}$$
(22)

and

$$\begin{aligned} \sum _{d\ell \le x}\frac{\phi (d)}{d}\frac{1}{\ell ^{2m}}&= \frac{\zeta (1+2m)}{\zeta (2)}x + \sum _{d\le x}\frac{\mu (d)}{d}\Delta _{-2m}\left( \frac{x}{d}\right) + O_{m}\left( \delta (x)\right) \end{aligned}$$
(23)

for any positive integer m. Suppose that \(x=[x]+\frac{1}{2}\). Under the Riemann Hypothesis, we have

$$\begin{aligned} \sum _{n\le x}\sum _{d|n}\frac{\phi (d)}{d}&= \frac{1}{\zeta (2)}x\log x + \frac{1}{\zeta (2)}\left( 2\gamma -1 - \frac{\zeta '(2)}{\zeta (2)}\right) x \nonumber \\&\quad + \sum _{d\le x}\frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) + O\left( \frac{\eta (x)\log x}{x^{1/2}}\right) , \end{aligned}$$
(24)

and

$$\begin{aligned} \sum _{d\ell \le x}\frac{\phi (d)}{d}\frac{1}{\ell ^{2m}}&= \frac{\zeta (1+2m)}{\zeta (2)}x + \sum _{d\le x}\frac{\mu (d)}{d}\Delta _{-2m}\left( \frac{x}{d}\right) + O_{m}\left( \frac{\eta (x)}{x^{1/2}}\right) \end{aligned}$$
(25)

Proof

We recall the identity \( \displaystyle \frac{\phi }{\mathrm{id}}*\mathbf{1}=\frac{\mu }{\mathrm{id}}*\tau . \) Using Eqs. (5), (10) and (11), we obtain

$$\begin{aligned}&\sum _{n\le x}\sum _{d|n}\frac{\phi (d)}{d} = \sum _{d\le x}\frac{\mu (d)}{d} \sum _{\ell \le x/d}\tau (\ell ) \\&\quad = x \left( \log x + 2\gamma -1 \right) \sum _{d\le x} \frac{\mu (d)}{d^2} - x \sum _{d\le x}\frac{\mu (d)}{d^2} \log d + \sum _{d\le x}\frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) \\&\quad =\frac{1}{\zeta (2)}x\log x + \frac{1}{\zeta (2)}\left( 2\gamma -1 - \frac{\zeta '(2)}{\zeta (2)}\right) x + \sum _{d\le x}\frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) + O\left( \delta (x)\right) , \end{aligned}$$

which completes the proof of Eq. (22). Further, we recall the identity \( \displaystyle \frac{\phi }{\mathrm{id}}*{\mathrm{id}}_{-2m} = \frac{\mu }{\mathrm{id}}*\sigma _{-2m}, \) and use Eqs. (6), (10) and (12) to get

$$\begin{aligned} \sum _{d\ell \le x} \frac{\phi (d)}{d}\frac{1}{\ell ^{2m}}&= \sum _{d\le x}\frac{\mu (d)}{d} \sum _{\ell \le x/d}\sigma _{-2m}(\ell ) \\&= \sum _{d\le x}\frac{\mu (d)}{d}\left( \zeta (1+2m)\frac{x}{d}-\frac{1}{2}\zeta (2m)+\Delta _{-2m}\left( \frac{x}{d}\right) \right) \\&=\frac{\zeta (1+2m)}{\zeta (2)}x + \sum _{d\le x}\frac{\mu (d)}{d}\Delta _{-2m}\left( \frac{x}{d}\right) + O_{m}\left( \delta (x)\right) . \end{aligned}$$

This completes the proof of Eq. (23). Similarly, we use Eqs. (13), (14) and (15) to deduce Eqs. (24) and (25). \(\square \)

Lemma 7

For any large positive number \(x > 5\), we have

$$\begin{aligned} \sum _{n\le x}\sum _{d|n}\frac{\mu *\phi (d)}{d}&= \frac{1}{\zeta ^{2}(2)}x\log x + \frac{1}{\zeta ^{2}(2)}\left( 2\gamma -1 - 2\frac{\zeta '(2)}{\zeta (2)}\right) x \nonumber \\&\quad + \sum _{d\le x}\frac{\mu *\mu (d)}{d}\Delta \left( \frac{x}{d}\right) + O\left( \kappa (x) \right) , \end{aligned}$$
(26)

and

$$\begin{aligned} \sum _{d\ell \le x}\frac{\mu *\phi (d)}{d}\frac{1}{\ell ^{2m}}&= \frac{\zeta (1+2m)}{\zeta ^{2}(2)}x + \sum _{d\le x}\frac{\mu *\mu (d)}{d}\Delta _{-2m}\left( \frac{x}{d}\right) + O_{m}\left( \kappa (x)\right) \end{aligned}$$
(27)

for any positive integer m. Here \(\kappa (x)\) is defined above in Lemma 4.

Proof

We use the identity \( \displaystyle \frac{\mu *\phi }{\mathrm{id}}*\mathbf{1}=\frac{\mu *\mu }{\mathrm{id}}*\tau , \) Eqs. (5), (16), and (17) to obtain

$$\begin{aligned}&\sum _{k\le x}\sum _{d|k}\frac{\mu *\phi (d)}{d} = \sum _{d\le x}\frac{\mu *\mu (d)}{d} \sum _{\ell \le x/d}\tau (\ell ) \\&\quad = x \left( \log x + 2\gamma -1 \right) \sum _{d\le x} \frac{\mu *\mu (d)}{d^2} - x\sum _{d\le x}\frac{\mu *\mu (d)}{d^2} \log d + \sum _{d\le x}\frac{\mu *\mu (d)}{d}\Delta \left( \frac{x}{d}\right) \\&\quad =\frac{x\log x}{\zeta ^{2}(2)} + \frac{1}{\zeta ^{2}(2)}\left( 2\gamma -1 - 2\frac{\zeta '(2)}{\zeta (2)}\right) x + \sum _{d\le x}\frac{\mu *\mu (d)}{d}\Delta \left( \frac{x}{d}\right) + O\left( \kappa (x)\right) , \end{aligned}$$

which completes the proof of Eq. (26). By using the fact that \( \displaystyle \frac{\mu *\phi }{\mathrm{id}}*{\mathrm{id}}_{-2m} = \frac{\mu *\mu }{\mathrm{id}}*\sigma _{-2m}, \) together with Eqs. (6), (16), and (18) we get

$$\begin{aligned} \sum _{d\ell \le x} \frac{\mu *\phi (d)}{d}\frac{1}{\ell ^{2m}}&= \sum _{d\le x}\frac{\mu *\mu (d)}{d} \sum _{\ell \le x/d}\sigma _{-2m}(\ell ) \\&=\frac{\zeta (1+2m)}{\zeta ^{2}(2)}x + \sum _{d\le x}\frac{\mu *\mu (d)}{d}\Delta _{-2m}\left( \frac{x}{d}\right) + O_{m}\left( \kappa (x)\right) . \end{aligned}$$

Therefore, Eq. (27) is proved. \(\square \)

Lemma 8

For any large positive number \(x> 5\), we have

$$\begin{aligned} \sum _{n\le x}\sum _{d|n}\frac{\mu *\psi (d)}{d}&= \frac{1}{\zeta ^{}(4)}x\log x + \frac{1}{\zeta ^{}(4)}\left( 2\gamma -1 - 2\frac{\zeta '(4)}{\zeta (4)}\right) x \nonumber \\&+ \sum _{d\le x}\frac{|\mu |*\mu (d)}{d}\Delta \left( \frac{x}{d}\right) + O\left( \frac{\delta (x)}{x^{1/2}}\right) , \end{aligned}$$
(28)

and

$$\begin{aligned} \sum _{d\ell \le x}\frac{\mu *\psi (d)}{d}\frac{1}{\ell ^{2m}}&= \frac{\zeta (1+2m)}{\zeta ^{}(4)}x \nonumber \\&\quad + \sum _{d\le x}\frac{|\mu |*\mu (d)}{d}\Delta _{-2m}\left( \frac{x}{d}\right) - \frac{\zeta (2m)}{2\zeta (2)} + O_{m}\left( \frac{\delta (x)}{x^{1/2}}\right) \end{aligned}$$
(29)

for any positive integer m.

Proof

From the identity \( \displaystyle \frac{{\mu *{\psi }}}{\mathrm{id}}*\mathbf{1}=\frac{\mu *|\mu |}{\mathrm{id}}*\tau , \) we have

$$\begin{aligned} \sum _{k\le x}\sum _{d|k}\frac{\mu *\psi (d)}{d} = \sum _{d\le x}\frac{\mu *|\mu |(d)}{d} \sum _{\ell \le x/d}\tau (\ell ). \end{aligned}$$

Using Eqs. (5), (19) and (20), we obtain the formula Eq. (28). Now, we use the identity \( \displaystyle \frac{\mu *\psi }{\mathrm{id}}*{\mathrm{id}}_{-2m} = \frac{\mu *|\mu |}{\mathrm{id}}*\sigma _{-2m} \) to write our second sums as follows

$$\begin{aligned} \sum _{d\ell \le x} \frac{\mu *\psi (d)}{d}\frac{1}{\ell ^{2m}} = \sum _{d\le x}\frac{\mu *|\mu |(d)}{d} \sum _{\ell \le x/d}\sigma _{-2m}(\ell ). \end{aligned}$$

Again, we use Eq. (6) to get

$$\begin{aligned} \sum _{d\ell \le x} \frac{\mu *\psi (d)}{d}\frac{1}{\ell ^{2m}} = \sum _{d\le x}\frac{\mu *|\mu |(d)}{d}\left( \zeta (1+2m)\frac{x}{d}-\frac{1}{2}\zeta (2m)+\Delta _{-2m}\left( \frac{x}{d}\right) \right) . \end{aligned}$$

Applying Eqs. (19) and (21) to the above, we deduce the desired result. \(\square \)

Now we are ready to prove our main theorems.

2.2 Proofs of the Theorems

Proof of Theorem 1

First, we take \(f=\mathrm{id}\) into Eq. (1) to get

$$\begin{aligned} M_r(x; \mathrm{id})&= \frac{1}{2}\sum _{n\le x}1 + \frac{1}{r+1} \sum _{d\ell \le x}\frac{\mu *\mathrm{id} (d)}{d}\nonumber \\&\quad + \frac{1}{r+1}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \sum _{d\ell \le x}\frac{\mu *\mathrm{id}(d)}{d}\frac{1}{\ell ^{2m}} \nonumber \\&= \frac{1}{2}\sum _{n\le x}1 + \frac{1}{r+1} \sum _{n\le x}\sum _{d|n}\frac{\phi (d)}{d} \nonumber \\&\quad + \frac{1}{r+1}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \sum _{d\ell \le x}\frac{\phi (d)}{d}\frac{1}{\ell ^{2m}}. \end{aligned}$$
(30)

Applying Eqs. (22) and (23) above yields

$$\begin{aligned} K_r(x)&= \frac{1}{r+1} \sum _{d\le x} \frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) \\&\quad + \frac{1}{r+1}\sum _{d\le x} \frac{\mu (d)}{d} \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \Delta _{-2m}\left( \frac{x}{d}\right) + O_{r}\left( \delta (x)\right) , \end{aligned}$$

which gives the desired result. We take \(f=\phi \) into Eq. (1) to get

$$\begin{aligned} M_r(x; \phi )&= \frac{1}{2}\sum _{n\le x}\frac{\phi (n)}{n} + \frac{1}{r+1} \sum _{n\le x}\sum _{d|n}\frac{\mu *\phi (d)}{d} \\&\quad + \frac{1}{r+1} \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \sum _{d\ell \le x}\frac{\mu *\phi (d)}{d}\frac{1}{\ell ^{2m}}. \end{aligned}$$

Using Lemma 2, as well as Eqs. (26) and (27), we get

$$\begin{aligned} L_r(x)&= \frac{1}{r+1} \sum _{n\le x} \frac{\mu *\mu (n)}{n}\Delta \left( \frac{x}{n}\right) \\&\quad + \frac{1}{r+1} \sum _{n\le x} \frac{\mu *\mu (n)}{n}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m}B_{2m}\Delta _{-2m}\left( \frac{x}{n}\right) \\&\quad + O_{r}\left( (\log x)^{2/3}(\log \log x)^{1/3}\right) , \end{aligned}$$

as desired. Taking \(f=\psi \) into Eq. (1) we get

$$\begin{aligned} M_r(x; \psi )&= \frac{1}{2}\sum _{n\le x}\frac{\psi (n)}{n} + \frac{1}{r+1} \sum _{d\ell \le x}\frac{\mu *\psi (d)}{d} \nonumber \\&\quad + \frac{1}{r+1} \sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \sum _{d\ell \le x}\frac{\mu *\psi (d)}{d}\frac{1}{\ell ^{2m}}. \end{aligned}$$
(31)

Applying Lemma 3, as well as Eqs. (28) and (29) in the above formula yields

$$\begin{aligned} U_r(x)&= \frac{1}{r+1} \sum _{n\le x} \frac{\mu *|\mu |(n)}{n}\Delta \left( \frac{x}{n}\right) \\&\quad + \frac{1}{r+1} \sum _{n\le x} \frac{\mu *|\mu |(n)}{n}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m}B_{2m}\Delta _{-2m}\left( \frac{x}{n}\right) \\&\quad - \frac{1}{4\zeta (2)}\log x + O_{r}\left( (\log x)^{2/3}\right) . \end{aligned}$$

This completes the proof of Theorem 1. \(\square \)

Proof of Theorem 2

By assuming the Riemann Hypothesis, and applying Eqs. (24) and (25) in Eq. (30), we immediately deduce that

$$\begin{aligned} K_r(x)&= \frac{1}{r+1} \sum _{d\le x} \frac{\mu (d)}{d}\Delta \left( \frac{x}{d}\right) \\&\quad + \frac{1}{r+1} \sum _{d\le x} \frac{\mu (d)}{d}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \Delta _{-2m}\left( \frac{x}{d}\right) + O_{r}\left( \frac{ \eta (x) \log x}{x^{1/2}} \right) , \end{aligned}$$

which completes the proof of Theorem 2. \(\square \)

3 Proofs of Theorems 3 and 4

To prove Theorems 3 we just need the following lemma.

Lemma 9

Under the hypotheses of Theorem 3, we have

$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n^2}&=\frac{1}{\zeta (2)} + \sum _{|\beta |\le T_{*}}\frac{x^{\rho -2}}{(\rho -2)\zeta '(\rho )} + \frac{\pi ^2}{\zeta (3)}x^{-4} + O\left( x^{-5}\right) ,\\ \sum _{n\le x}\frac{\mu (n)}{n^2}\log \frac{x}{n}&=\frac{1}{\zeta (2)}\left( \log x - \frac{\zeta '(2)}{\zeta ^{}(2)}\right) \\&\quad + \sum _{|\beta |\le T_{*}}\frac{x^{\rho -2}}{(\rho -2)^{2}\zeta '(\rho )} - \frac{\pi ^2}{4\zeta (3)}x^{-4} + O\left( x^{-5}\right) , \end{aligned}$$

and

$$\begin{aligned} \sum _{n\le x}\frac{\mu (n)}{n}&= \sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -1)\zeta '(\rho )} + \frac{4 \pi ^2}{3\zeta (3)}x^{-3} + O\left( x^{-5}\right) . \end{aligned}$$

Proof

The proof of the lemma can be found in [8, Lemma 3.5]. \(\square \)

Proof of Theorem 3

We recall that

$$\begin{aligned} M_r(x; {\mathrm{id}})&= \frac{1}{2}\sum _{n\le x}1 + \frac{1}{r+1} \sum _{d\ell \le x}\frac{\mu * {\mathrm{id(d)}}}{d} \\&\quad + \frac{1}{r+1}\sum _{m=1}^{[r/2]}{r+1 \atopwithdelims ()2m} B_{2m} \sum _{d\ell \le x}\frac{\mu *{\mathrm{id(d)}}}{d}\frac{1}{\ell ^{2m}}. \end{aligned}$$

Using the fact that

$$\begin{aligned} \frac{\mu *{\mathrm{id}}}{\mathrm{id}}* \mathbf{{1}}= \frac{\mu }{\mathrm{id}}* \tau , \qquad \qquad \frac{\mu *{\mathrm{id}}}{\mathrm{id}}*{\mathrm{id}}_{-2m}= \frac{\mu }{\mathrm{id}}*\sigma _{-2m}, \end{aligned}$$

and Eqs. (5) and (6), we get

$$\begin{aligned} M_r(x; {\mathrm{id}})&= \frac{[x]}{2} + \frac{x}{r+1} \sum _{n\le x}\frac{\mu (n)}{n^2}\log \frac{x}{n} + \frac{x}{r+1}\left( 2\gamma -1 + C_{\mathrm{{odd}}}(r) \right) \sum _{n\le x}\frac{\mu (n)}{n^2} \\&\quad - \frac{C_{\mathrm{{even}}}(r)}{2(r+1)} \sum _{n\le x}\frac{\mu (n)}{n} \nonumber + \frac{1}{r+1}\sum _{n\le x}\frac{\mu (n)}{n}\Delta \left( \frac{x}{n}\right) \\&\quad + \frac{1}{r+1}\sum _{m=1}^{[r/2]} {r+1 \atopwithdelims ()2m} B_{2m}\sum _{n\le x}\frac{\mu (n)}{n} \Delta _{-2m}\left( \frac{x}{n}\right) . \end{aligned}$$

Under the hypotheses of the theorem, we use Lemma 9 to obtain

$$\begin{aligned} M_r(x;{\mathrm{id}})&= \frac{[x]}{2}+ \frac{x\log x }{(r+1)\zeta (2)} + \frac{x}{(r+1)\zeta (2)}\left( 2\gamma - 1- \frac{\zeta '(2)}{\zeta (2)} + C_{\mathrm{{odd}}}(r) \right) \\&\quad + \frac{1}{r+1}\sum _{n\le x}\frac{\mu (n)}{n}\Delta \left( \frac{x}{n}\right) + \frac{1}{r+1}\sum _{m=1}^{[r/2]} {r+1 \atopwithdelims ()2m} \\&\quad B_{2m}\zeta (2m)\sum _{n\le x}\frac{\mu (n)}{n}\Delta _{-2m}\left( \frac{x}{n}\right) \\&\quad + \frac{1}{r+1}\left( 2\gamma -1 + C_{\mathrm{{odd}}}(r) \right) \sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -2)\zeta '(\rho )} \\&\quad + \frac{1}{r+1}\sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -2)^2 \zeta '(\rho )} - \frac{C_{\mathrm{{even}}}(r)}{2(r+1)} \\&\quad \sum _{|\beta |\le T_{*}}\frac{x^{\rho -1}}{(\rho -1)\zeta '(\rho )} + O_{r}\left( x^{-3}\right) , \end{aligned}$$

which completes the proof. \(\square \)

Proof of Theorem 4

To prove our theorem it suffices to show that

$$\begin{aligned} \sum _{|\beta | \le T_{*}} \frac{x^{-\frac{1}{2}+i\beta }}{(-j+i\beta ) \zeta '(\frac{1}{2}+i\beta )} = O\left( x^{-1/2}(\log x)^{5/4}\right) \end{aligned}$$

with \(j=1/2\) and 3/2. We take \(\lambda =-1/2\) into Eq. (9), then \( \displaystyle J_{-1/2}(T_{*}) \ll T_{*}(\log T_{*})^{1/4}. \) Using the above and partial summation we have

$$\begin{aligned}&\sum _{|\beta | \le T_{*}} \frac{1}{\beta |\zeta '(\frac{1}{2}+i\beta )|} \ll \left[ \frac{J_{-1/2}(t)}{t^{}}\right] _{14}^{T_{*}} + \int _{14}^{T_{*}}\frac{J_{-1/2}(t)}{t^{2}}dt \ll (\log T_{*})^{5/4}, \end{aligned}$$

and the proof is complete. \(\square \)