\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{8.9in}

\newcommand{\seqnum}[1]{\href{http://www.research.att.com/cgi-bin/access.cgi/as/~njas/sequences/eisA.cgi?Anum=#1}{\underline{#1}}}

\DeclareMathOperator*{\Res}{Res}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\begin{center}
\vskip 1cm{\LARGE\bf On the Gcd-Sum Function
}
\vskip 1cm
\large
Yoshio Tanigawa\\
Graduate School of Mathematics \\
Nagoya University\\
Chikusa-ku, Nagoya 464-8602 \\
Japan\\
\href{mailto:tanigawa@math.nagoya-u.ac.jp}{\tt tanigawa@math.nagoya-u.ac.jp}\\

\ \\

Wenguang Zhai\\
School of Mathematical Sciences \\
Shandong Normal University \\
Jinan 250014, Shandong \\
 P. R. China\\
\href{mailto:zhaiwg@hotmail.com}{\tt zhaiwg@hotmail.com} \\
\end{center}

\vskip .2 in

\begin{abstract}
In this paper we give a unified   asymptotic formula for the partial
gcd-sum function. We also study the mean-square of the error in the asymptotic
formula.
\end{abstract}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{conjecture}[theorem]{Conjecture}

\newtheorem{thm}{Theorem}
\newtheorem{cor}{Corollary}
\newtheorem{lem}{Lemma}[section]
\newcommand{\bvec}[1]{\mbox{\boldmath$#1$}}
\renewcommand{\d}{\displaystyle}
\renewcommand\thefootnote{\fnsymbol{footnote}}

\footnote[0]{The second-named author is supported by
National Natural Science Foundation of China (Grant No. 10771127)
and National Natural Science Foundation of Shandong Province(Grant
No. Y2006A31).}

%************************* section 1 *******************************************

\section{Introduction}

Pillai \cite{P} first defined  the gcd-sum (Pillai's function) by the
relation
\begin{equation}
g(n):=\sum_{j=1}^{n}\gcd(j,n),
\end{equation}
where $\gcd(a,b)$ denotes the greatest common divisor of $a$ and
$b$. This is Sequence \seqnum{A018804} in Sloane's {\it Online Encyclopedia
of Integer Sequences}. Pillai \cite{P} proved that 
$$
g(n)=n\sum_{d|n}\frac{\varphi(n)}{d},
$$
where $\varphi(n)$ is Euler's function.  This fact was proved again by Broughan \cite{BR}.
He also obtained the asymptotic formula of the partial sum function
$$
G_\alpha(x):=\sum_{n\leq x}g(n)n^{-\alpha}
$$
for any $\alpha\in {\Bbb R},$ which was further improved in
Bordell\`{e}s \cite{BO} (the case $\alpha=0$) and Broughan \cite{BR2} (the general case)
respectively.

The estimate of $G_\alpha(x)$ is closely related to the well-known
Dirichlet divisor problem. For any $x>0,$ define
$$
\Delta(x):=\sum_{n \leq x}d(n)-x(\log x+2\gamma-1),
$$
where $d(n)$ denotes the Dirichlet divisor function and $\gamma$ is
Euler's constant. Dirichlet first proved that
$\Delta(x)=O(x^{1/2})$. The exponent $1/2$ was improved by many
authors. The latest result reads
\begin{equation}
\Delta(x)\ll x^{131/416}(\log x)^{26947/8320 },
\end{equation}
due to Huxley \cite{H}. It is conjectured that
\begin{equation}
\Delta(x)=O(x^{1/4+\varepsilon}),
\end{equation}
which is supported by the classical mean square result
\begin{equation}
\int_1^T\Delta^2(x)dx=\frac{\zeta^4(3/2)}{6\pi^2\zeta(3)}T^{3/2}+O(T\log^5 T)
\end{equation}
proved by Tong \cite{T}.

In the sequel of this paper, $\theta$ denotes the number defined by
\begin{equation}
\theta:=\inf\{a \, |\, \Delta(x) \ll x^{a}\}.
\end{equation}

Broughan \cite{BR2} proved that

(1) If $\alpha\leq 1+\theta,$ then
\begin{align}
G_\alpha(x)=& \frac{x^{2-\alpha}\log x}{(2-\alpha)\zeta(2)}+
\frac{x^{2-\alpha}}{(2-\alpha)\zeta(2)}\left(2\gamma-\frac{1}{2-\alpha}-\frac{\zeta^{\prime}(2)}{\zeta(2)}\right)\nonumber \\[1ex]
& {}+O(x^{\theta+1-\alpha+\varepsilon});
\end{align}

(2) If $ 1+\theta<\alpha<2,$ then
\begin{align}
G_\alpha(x)=&\frac{x^{2-\alpha}\log x}{(2-\alpha)\zeta(2)}+
\frac{x^{2-\alpha}}{(2-\alpha)\zeta(2)}\left(2\gamma-\frac{1}{2-\alpha}-\frac{\zeta^{\prime}(2)}{\zeta(2)}\right)\nonumber \\[1ex]
& +O(1);
\end{align}

(3) If $\alpha=2,$ then
\begin{align}
G_\alpha(x)=&\frac{\log^2 x}{2\zeta(2)}+ \frac{\log
x}{\zeta(2)}\left(2\gamma
-\frac{\zeta^{\prime}(2)}{\zeta(2)}\right)+O(1);
\end{align}

(4) If $\alpha>2,$ then
\begin{align}
G_\alpha(x)=&\frac{x^{2-\alpha}\log x}{(2-\alpha)\zeta(2)}+
\frac{x^{2-\alpha}}{(2-\alpha)\zeta(2)}\left(2\gamma-\frac{1}{2-\alpha}-\frac{\zeta^{\prime}(2)}{\zeta(2)}\right)\nonumber \\[1ex]
& {}+\frac{\zeta^2(\alpha-1)}{\zeta(\alpha)}+O(x^{\theta+1-\alpha+\varepsilon}).
\end{align}

In this paper we first give a unified asymptotic formula of
$G_\alpha(x)$. Before stating our result, we introduce the following definitions:
\begin{align}
M_\alpha(x):=\left\{\begin{array}{ll}
\d \frac{x^{2-\alpha}\log x}{(2-\alpha)\zeta(2)}+\frac{x^{2-\alpha}}{(2-\alpha)\zeta(2)}
\left(2\gamma-\frac{1}{2-\alpha}-\frac{\zeta^{\prime}(2)}{\zeta(2)}\right),
 &\mbox{if $\alpha\not= 2;$}\\[1em]
\d \frac{\log^2x}{2\zeta(2)}-\left(\frac{\zeta^{\prime}(2)}{\zeta^2(2)}
+\frac{2\gamma}{\zeta(2)}\right)\log x,
& \mbox{if $\alpha=2,$}
\end{array}\right.
\end{align}
and
\begin{align}
\d c(\beta):=\left\{\begin{array}{ll} 0,&\mbox{if $\beta\leq 0;$}\\[1ex]
\d \beta\int_0^\infty \Delta(x)x^{-\beta-1}dx,& \mbox{if $0<\beta<1;$}\\[1ex]
\d 2\gamma-1+\int_1^\infty \Delta(x)x^{-2}dx,&\mbox{if $\beta=1;$}\\[1ex]
\d \zeta^2(\beta),&\mbox{if $\beta>1.$}
\end{array}\right.
\end{align}

We then have
\begin{thm} \label{theorem 1}
Suppose $\alpha\in {\Bbb R}$ is fixed. Then
\begin{equation}
G_\alpha(x)=M_\alpha(x)+C(\alpha)+O(x^{\theta+1-\alpha+\varepsilon}),
\end{equation}
where
\begin{align*}
C(\alpha):=\left\{\begin{array}{ll}
\d 0,&\mbox{if\, $\alpha\leq 1;$}\\[1ex]
\d c(\alpha-1)/\zeta(\alpha) ,& \mbox{if \, $1<\alpha<2;$}\\[1ex]
\d \frac{c(1)}{\zeta(2)}+\frac{2\zeta^{\prime 2}(2)
  -\zeta(2)\zeta^{\prime\prime}(2)}{2\zeta^3(2)}-
  \frac{2\gamma \zeta^{\prime}(2)}{\zeta^2(2)},&\mbox{if\, $\alpha=2;$}\\[2ex]
\d \frac{\zeta^2(\alpha-1)}{\zeta(\alpha)},&\mbox{if\, $\alpha>2.$}
\end{array}\right.
\end{align*}
\end{thm}

\noindent {\bf Remark 1.} Theorem \ref{theorem 1} slightly improves Broughan's result in
the case $1+\theta<\alpha\leq 2.$

\medskip

Define the error term $E_\alpha(x)$ by
$$E_\alpha(x):=G_\alpha(x)-M_\alpha(x)-C(\alpha).$$
For this error term, we have the following mean square results.

\begin{thm} \label{theorem 2}
For any fixed $\alpha\in {\Bbb R},$ we have the asymptotic formula
\begin{equation}
\int_1^Tx^{2\alpha-2}E^2_\alpha(x)dx=C_2T^{3/2}+O(T^{5/4+\varepsilon}),
\end{equation}
 where
$$
C_2=\frac{1}{6\pi^2}\sum_{n=1}^\infty h_0^2(n)n^{-3/2},
\quad h_0(n)=\sum_{n=ml}\mu(m)d(l)m^{-1/2}.
$$
\end{thm}

\begin{cor} If $\alpha<7/4,$ then
\begin{equation}
\int_1^T E^2_\alpha(x)dx=\frac{3C_2}{7-4\alpha}T^{7/2-2\alpha}+O(T^{13/4-2\alpha+\varepsilon}).
\end{equation}
\end{cor}

\medskip

For the upper bound of $E_{\alpha}(x)$, we propose the following conjecture.

\noindent {\bf Conjecture.} The estimate
$$E_\alpha(x)\ll x^{5/4-\alpha+\varepsilon}$$
holds for any $\alpha\in {\Bbb R}.$

\medskip

Throughout this paper, $\varepsilon$ denotes an arbitrary small positive number which does not
need to be the same at each occurrence. When the summation conditions of a sum are complicated,
we write the conditions separately like $SC(\Sigma)$.

%********************  section 2  *****************************************

\section{\bf Proof of Theorem \ref{theorem 1}}

In this section we prove Theorem \ref{theorem 1}. First we prove the following

\begin{lem} \label{lemma 21}
Suppose $\beta\in {\Bbb R}\setminus\{0\}$ and define
$D_\beta(x):=\sum_{n\leq x}d(n)n^{-\beta}.$ Then we have
\begin{align}
D_\beta(x)&=\frac{x^{1-\beta}\log x}{1-\beta}+\frac{x^{1-\beta}}{1-\beta}
\left(2\gamma-\frac{1}{1-\beta}\right) \nonumber \\
& \quad {}+c(\beta)+x^{-\beta}\Delta(x)+O(x^{-\beta})  \qquad \mbox{{\hfill for} $\beta\not=1$}
\end{align}
and
\begin{equation}
D_1(x)=\frac{\log^2 x}{2}+ 2\gamma\log x+c(1)+\Delta(x)x^{-1}+O(x^{-1}),
\end{equation}
where $c(\beta)$ is defined in (1.10).
\end{lem}

\begin{proof}
First consider the case $\beta<1.$ By integration by parts we have
\begin{align}
D_\beta(x)&=\sum_{0<n\leq x}d(n)n^{-\beta}=\int_0^x t^{-\beta}dD(t) \nonumber\\
&=\int_0^x t^{-\beta}dH(t)+\int_0^x t^{-\beta}d\Delta(t)\nonumber\\
&=\int_0^x t^{-\beta}(\log t+2\gamma)dt+t^{-\beta}\Delta(t)\Big|_0^x
  +\beta\int_0^x\Delta(t)t^{-\beta-1}dt\nonumber\\
&=\frac{x^{1-\beta}\log x}{1-\beta}+\frac{x^{1-\beta}}{1-\beta}
  \left(2\gamma-\frac{1}{1-\beta}\right)+x^{-\beta}\Delta(x)\nonumber\\
& \quad {}+\beta\int_0^x\Delta(t)t^{-\beta-1}dt,
\end{align}
where
$$
D(t)=\sum_{n \leq t}d(n)
$$
and
$$
H(t)=t\log t+(2\gamma-1)t.
$$
Note that, from the definition of $\Delta(x)$,
$$
\Delta(x)=-x\log x-(2\gamma-1)x
$$
for $0<x<1$, which implies that the integral $\int_0^1\Delta(t)t^{-\beta-1}dt$ is convergent.
To treat the last integral in (2.3) we recall the well-known formula (see Vorono\"{\i} \cite{V})
\begin{equation}
\int_0^T\Delta(x)dx=T/4+O(T^{3/4}),
\end{equation}
which combined with integration by parts gives
\begin{equation}
\beta\int_0^x\Delta(t)t^{-\beta-1}dt\ll x^{-\beta} \qquad (\beta<0)
\end{equation}
and
\begin{equation}
\beta\int_x^\infty\Delta(t)t^{-\beta-1}dt\ll x^{-\beta} \qquad (\beta>0).
\end{equation}
Especially, (2.6) shows that the infinite integral $\int_0^\infty\Delta(t)t^{-\beta-1}dt$ converges in the
case $\beta>0.$ The assertion of Lemma \ref{lemma 21}
for the case $\beta<1$ follows from (2.3), (2.5) and (2.6).

Next consider the case $\beta>1.$ Since the infinite series
$\sum_{n=1}^{\infty}d(n)n^{-\beta}$ converges to $\zeta^2(\beta)$, we may write
\begin{equation}
D_\beta(x)=\zeta^2(\beta)-\sum_{n>x}d(n)n^{-\beta}.
\end{equation}
By integration by parts and (2.6) we get
\begin{align}
\sum_{n>x}d(n)n^{-\beta}
&=\int_x^\infty t^{-\beta}dH(t)+\int_x^\infty t^{-\beta}d\Delta(t) \nonumber \\
&=\int_x^\infty t^{-\beta}(\log t+2\gamma)dt+t^{-\beta}\Delta(t)|_x^\infty
  +\beta\int_x^\infty\Delta(t)t^{-\beta-1}dt\nonumber\\
&=-\frac{x^{1-\beta}\log x}{1-\beta}-\frac{x^{1-\beta}}{1-\beta}\left(2\gamma-\frac{1}{1-\beta}\right)
-x^{-\beta}\Delta(x) +O(x^{-\beta}).
\end{align}
The assertion of Lemma \ref{lemma 21} for the case $\beta>1$ follows from (2.7) and (2.8).

Finally consider the case $\beta=1$. We have
\begin{align}
D_1(x)&=1+\sum_{1<n\leq x}d(n)n^{-1} \nonumber\\
&=1+\int_1^x t^{-1} dH(t)+\int_1^x t^{-1} d\Delta(t) \nonumber\\
&=1+\int_1^x t^{-1}(\log t+2\gamma)dt+\Delta(t)t^{-1} \Big|_1^{x}
  +\int_1^x \Delta(t) t^{-2} dt \nonumber\\
&=\frac{\log^2 x}{2}+2\gamma \log x+1+\Delta(x)x^{-1}-\Delta(1)
  +\int_1^\infty \Delta(t)t^{-2}dt+O(x^{-1})\nonumber\\
&=\frac{\log^2 x}{2}+2\gamma \log x+2\gamma-1+\int_1^\infty \Delta(t) t^{-2}dt
  +\Delta(x)x^{-1}+O(x^{-1}),
\end{align}
where we used (2.6) and the fact $\Delta(1)=2-2\gamma$ which
follows from the definition of $\Delta(x).$

This completes the proof of Lemma \ref{lemma 21}.
\end{proof}


{\it Proof of Theorem \ref{theorem 1}.} Broughan \cite{BR2} proved that
\begin{equation}
G_\alpha(x)=\sum_{m\leq x}\mu(m)m^{-\alpha}\sum_{n\leq
x/m}d(n)n^{1-\alpha}.
\end{equation}

  From (2.10), Lemma 2.1 and some easy calculations, we get
\begin{equation}
G_\alpha(x)=M_\alpha(x)+C(\alpha)+E_\alpha(x),
\end{equation}
where
\begin{equation}
E_\alpha(x)=x^{1-\alpha}\sum_{m\leq
x}\frac{\mu(m)}{m}\Delta(\frac{x}{m})+O(x^{1-\alpha}\log x),
\end{equation}
which is $O(x^{\theta+1-\alpha+\varepsilon})$, completing the proof of Theorem \ref{theorem 1}.

\medskip

\noindent {\bf Remark 2.} Vorono\"{\i} \cite{V} actually proved
\begin{equation}
\int_0^T\Delta(x)dx=\frac{T}{4}+\frac{T^{3/4}}{2\sqrt
2\pi^2}\sum_{n=1}^\infty
\frac{d(n)}{n^{5/4}}\sin(4\pi\sqrt{nT}-\pi/4)+O(T^{1/4}).
\end{equation}
Replacing the formula (2.4) in the proof of Lemma 2.1 it is easy to
check that  $\log x$ in the error term of (2.12) can be removed.


%********************  section 3  **************************************

\section{Proof of Theorem \ref{theorem 2}}

In order to prove Theorem \ref{theorem 2} we need the following well-known Vorono\"{\i}
formula (see, e.g., Ivi\'c \cite{I}).

\begin{lem} \label{lemma 31}
Suppose $A>0$ is any fixed constant.   If $1\ll N\ll x^A,$ then
$$
\Delta(x)=\frac{x^{1/4}}{\pi\sqrt 2}\sum_{n\leq
N}\frac{d(n)}{n^{3/4}}\cos\left(4\pi\sqrt{nx}-\frac{\pi}{4}\right)
+O(x^\varepsilon+x^{1/2+\varepsilon}N^{-1/2}).
$$
\end{lem}

It suffices to evaluate the integral $\int_T^{2T}x^{2\alpha-2}E^2_\alpha(x)dx.$
Let
$$
y=T^{1-\varepsilon}.
$$
By (2.12) we have
\begin{align*}
x^{\alpha-1}E_{\alpha}(x)
&=\sum_{m \leq y}\frac{\mu(m)}{m}\Delta\left(\frac{x}{m}\right)+
  \sum_{y \leq m \leq x}\frac{\mu(m)}{m}\Delta\left(\frac{x}{m}\right)+O(\log x) \nonumber \\
&=:F_1(x)+F_2(x)+O(\log x),
\end{align*}
say. For $F_2(x)$, we have $\Delta(x/m) \ll (x/y)^{1/3} \ll T^{\varepsilon}$, therefore
$$
F_2(x) \ll \sum_{y<m \leq x}\frac{1}{m}\left|\Delta\left(\frac{x}{m}\right)\right|
\ll T^{\varepsilon}.
$$
For $F_1(x)$, we can take $N=y$ in Lemma \ref{lemma 31}
 with a suitable $A$ (e.g., $A=(1+\varepsilon)/\varepsilon$),
hence we get
$$
F_1(x)=E^{*}(x)+O(T^{\varepsilon}),
$$
where
$$
E^{*}(x)=\frac{x^{1/4}}{\sqrt 2\pi}\sum_{m\leq y}\frac{\mu(m)}{m^{5/4}}
\sum_{n\leq y}\frac{d(n)}{n^{3/4}}\cos\left(4\pi\sqrt{\frac{nx}{m}}-\frac{\pi}{4}\right).
$$
As a result we get an expression of $x^{\alpha-1}E_{\alpha}(x)$:
\begin{eqnarray}
x^{\alpha-1}E_\alpha(x)=E^{*}(x)+O(T^{\varepsilon}).
\end{eqnarray}

Now we consider the mean square of $E^{*}(x).$ By the elementary
formula
$$
\cos u\cos v=\frac{1}{2}(\cos {(u-v)}+\cos {(u+v)})
$$
we may write
\begin{align}
|E^{*}(x)|^2
&=\frac{x^{1/2}}{2\pi^2}\sum_{m_1,m_2\leq y} \frac{\mu(m_1)\mu(m_2)}{(m_1m_2)^{5/4}}
  \sum_{n_1, n_2\leq y}\frac{d(n_1)d(n_2)}{(n_1n_2)^{3/4}} \nonumber \\
& \hspace{10mm}\times \cos{\left(4\pi\sqrt{\frac{n_1x}{m_1}}-\frac{\pi}{4}\right)}
    \cos{\left(4\pi\sqrt{\frac{n_2x}{m_2}}-\frac{\pi}{4}\right)}\nonumber\\
&=S_1(x)+S_2(x)+S_3(x),
\end{align}
where
\begin{align*}
S_1(x)&=\ \frac{x^{1/2}}{4\pi^2}
\sum\nolimits_{1} \frac{\mu(m_1)\mu(m_2)}{(m_1m_2)^{5/4}}\frac{d(n_1)d(n_2)}{(n_1n_2)^{3/4}},\\
S_2(x)&=\ \frac{x^{1/2}}{4\pi^2}\sum\nolimits_{2}
\frac{\mu(m_1)\mu(m_2)}{(m_1m_2)^{5/4}}\frac{d(n_1)d(n_2)}{(n_1n_2)^{3/4}}
\cos{\left(4\pi\sqrt x \left(\sqrt{\frac{n_1}{m_1}}
-\sqrt{\frac{n_2}{m_2}} \right) \right)},\\
%\intertext{and}
S_3(x)&=\ \frac{x^{1/2}}{4\pi^2}\sum\nolimits_{3}\frac{\mu(m_1)\mu(m_2)}{(m_1m_2)^{5/4}}
\frac{d(n_1)d(n_2)}{(n_1n_2)^{3/4}}\sin{\left(4\pi\sqrt x\left(\sqrt{\frac{n_1}{m_1}}
+\sqrt{\frac{n_2}{m_2}} \right)\right)},
\end{align*}
with summation conditions
\begin{align*}
&SC(\Sigma_1): m_1, m_2, n_1, n_2\leq y, \quad n_1m_2=n_2m_1, \\
&SC(\Sigma_2): m_1, m_2, n_1, n_2\leq y, \quad n_1m_2\not= n_2m_1, \\
&SC(\Sigma_3): m_1, m_2, n_1, n_2\leq y,
\end{align*}
respectively.

We have
\begin{equation}
\int_T^{2T}S_1(x)dx=\frac{B(T)}{4\pi^2}\int_T^{2T}x^{1/2}dx,
\end{equation}
where
$$
B(T)=\sum\nolimits_{1} \frac{\mu(m_1)\mu(m_2)}{(m_1m_2)^{5/4}}\frac{d(n_1)d(n_2)}{(n_1n_2)^{3/4}}.
$$
We evaluate $B(T)$. It is written as
\begin{align*}
B(T)&=\sum\nolimits_{1}\frac{\mu(m_1)\mu(m_2)d(n_1)d(n_2)(m_1m_2)^{-1/2}}{(n_1m_2n_2m_1)^{3/4}}\\
&=\sum_{n\leq y^2}h^2(n;y)n^{-3/2},
\end{align*}
where
$$
h(n;y)=\sum_{\stackrel{n=ml}{m, l\leq y}}\mu(m)d(l)m^{-1/2}.
$$
Let
$$
h_0(n)=\sum_{n=ml}\mu(m)d(l)m^{-1/2},\hspace{2mm}h_1(n)=\sum_{n=ml}d(l)m^{-1/2}.
$$
Obviously,
\begin{eqnarray*}
&&h(n;y)=h_0(n),\hspace{2mm}n\leq y,\\
&&|h(n;y)|\leq h_1(n), \quad |h_0(n)|\leq h_1(n), n\geq 1.
\end{eqnarray*}
Since $h_1(n)$ is a multiplicative function, by using Euler's product, it is easy to show that
$$
\sum_{n=1}^\infty h_1^2(n)n^{-s}=\zeta^4(s)M(s),\quad \Re s>1,
$$
where $M(s)$ is regular for $\Re s>1/2.$ Thus
$$
\sum_{n\leq x}h_1^2(n)\ll x\log^3 x.
$$
 From the above estimates we get
\begin{align}
B(T)&=\sum_{n\leq y}h_0^2(n)n^{-3/2}+O\left(\sum_{y<n\leq y^2}h_1^2(n)n^{-3/2}\right)\nonumber \\
&=\sum_{n=1}^\infty h_0^2(n)n^{-3/2}+O\left(\sum_{n>y}h_1^2(n)n^{-3/2}\right)\nonumber\\
&=\sum_{n=1}^\infty h_0^2(n)n^{-3/2}+O(y^{-1/2}\log^3 y).
\end{align}

Next we consider the integral of $S_2(x)$. By the first derivative test we get
\begin{align}
\int_T^{2T}S_2(x)dx
&\ll T \sum\nolimits_{2}\frac{d(n_1)d(n_2)}{(m_1m_2)^{5/4}(n_1n_2)^{3/4}}
     \frac{1}{\left|\sqrt\frac{n_1}{m_1}-\sqrt\frac{n_2}{m_2}\right|} \nonumber \\
%&\ll T \sum_{2}\frac{d(n_1)d(n_2)}{(m_1m_2)^{3/4}(n_1n_2)^{3/4}}
%     \frac{1}{\left|\sqrt{n_1m_2}-\sqrt{n_2m_1} \right |}\nonumber\\
&\ll T \sum\nolimits_{2} \frac{d(n_1)d(n_2)}{(n_2m_1n_1m_2)^{3/4}}
     \frac{1}{\left|\sqrt{n_1m_2} -\sqrt{n_2m_1} \right |}\nonumber\\
&\ll T\sum_{\begin{subarray}{c} n,m\leq y^2 \\ n \not=m \end{subarray}}
     \frac{d_3(m)d_3(n)}{n^{3/4}m^{3/4}} \frac{1}{|\sqrt n-\sqrt m|}\nonumber\\
&\ll T\sum_{\begin{subarray}{c} n,m\leq y^2 \\ |\sqrt n-\sqrt m|\geq \frac12(mn)^{1/4} \end{subarray}}
     \frac{d_3(m)d_3(n)}{n^{3/4}m^{3/4}}\frac{1}{|\sqrt n-\sqrt m|}\nonumber\\
& \quad {} + T \sum_{\begin{subarray}{c} n,m\leq y^2 \\ 0<|\sqrt n-\sqrt m|< \frac12 (mn)^{1/4}
   \end{subarray}} \frac{d_3(m)d_3(n)}{n^{3/4}m^{3/4}}\frac{1}{|\sqrt n-\sqrt m|}\nonumber\\
&\ll T \left(\sum_{n\leq y^2}d_3(n)n^{-1}\right)^2
     +T\sum_{\begin{subarray}{c} n,m\leq y^2 \\ n\not= m \end{subarray}}
     \frac{d_3(m)d_3(n)}{n^{1/2}m^{1/2}}\frac{1}{|n-m|}\nonumber\\
&\ll T\log^9 T+T\sum_{n\leq y^2}d_3^2(n)n^{-1}\ll T\log^9 T,
\end{align}
where we used the well-known Hilbert's inequality and the estimates
$$\sum_{n\leq x}d_3(n)\ll x\log^2 x,\ \ \ \sum_{n\leq x}d_3^2(n)\ll x\log^8 x.$$

For the integral of $S_3(x)$, by the first derivative test again, we get
\begin{align}
\int_T^{2T}S_3(x)dx
&\ll T \sum\nolimits_{3}\frac{d(n_1)d(n_2)}{(m_1m_2)^{5/4}(n_1n_2)^{3/4}}
     \frac{1}{\left|\sqrt\frac{n_1}{m_1}+\sqrt\frac{n_2}{m_2}\right|} \nonumber \\
&\ll T \sum\nolimits_{3}\frac{d(n_1)d(n_2)}{(m_1m_2)^{5/4}(n_1n_2)^{3/4}}
     \frac{1}{(\frac{n_1}{m_1})^{1/4}(\frac{n_2}{m_2})^{1/4}}\nonumber\\
&\ll T \sum\nolimits_{3}\frac{d(n_1)d(n_2)}{m_1m_2n_1n_2}\ll T\log^6T.
\end{align}

 From (3.2)-(3.6) we get
\begin{align}
\int_T^{2T}|E^{*}(x)|^2dx
&=\frac{1}{4\pi^2}\sum_{n=1}^\infty h_0^2(n)n^{-3/2}\int_T^{2T}x^{1/2}dx \nonumber\\
& \quad {}+O(T^{3/2}y^{-1/2}\log^3 T+T\log^9 T)\nonumber\\
&=\frac{1}{4\pi^2}\sum_{n=1}^\infty h_0^2(n)n^{-3/2}\int_T^{2T}x^{1/2}dx+O(T^{1+\varepsilon}).
\end{align}
 From (3.1), (3.7) and Cauchy's inequality we get
\begin{align}
\int_T^{2T}x^{2\alpha-2}|E_\alpha(x)|^2dx
=\frac{1}{4\pi^2}\sum_{n=1}^\infty h_0^2(n)n^{-3/2}\int_T^{2T}x^{1/2}dx +O(T^{5/4+\varepsilon}),
\end{align}
which implies  Theorem \ref{theorem 2}  by a splitting argument.

\medskip

\noindent {\bf Remark 3.} The referee kindly indicated that the average order of $h_1^2(n)$
is also derived by Shiu's theorem. Indeed, since $h_1(n) \ll d_3(n) \ll n^{\varepsilon}$ we have
\begin{align*}
\sum_{n \leq x}h_1^2(n) & \ll \frac{x}{\log x}\exp \left(\sum_{p \leq x}\frac{h_1^2(p)}{p}\right) \\
& \ll \frac{x}{\log x}\exp \left(\sum_{p \leq x}
      \left(\frac{4}{p}+\frac{4}{p^{3/2}}+\frac{1}{p^2}\right)\right)\\[1ex]
&\ll x (\log x)^3.
\end{align*}


\section{Acknowledgments}

The authors express their gratitude to the referee for careful
reading of the manuscript and many valuable suggestions,
especially pointing out 
Pillai's paper and Remark 3 to the authors. 


\begin{thebibliography}{99}
\bibitem{BO}O. Bordell\`{e}s,  
\href{http://www.cs.uwaterloo.ca/journals/JIS/VOL10/Bordelles/bordelles90.html}{A note on the average order of the gcd-sum
function}, {\it J. Integer Sequences} {\bf 10} (2007), Article 07.3.3.

\bibitem{BR}K. Broughan, \href{http://www.cs.uwaterloo.ca/journals/JIS/VOL4/BROUGHAN/gcdsum.pdf}{The gcd-sum function}, {\it J. Integer Sequences}
{\bf 4} (2001), Article 01.2.2.

\bibitem{BR2}K. Broughan,
\href{http://www.cs.uwaterloo.ca/journals/JIS/VOL10/Broughan/broughan1.html}{The average order of the Dirichlet series of the gcd-sum
function}, {\it J. Integer Sequences} {\bf 10} (2007), Article 07.4.2.

\bibitem{H} M. N. Huxley,  Exponential sums and Lattice points III,
{\it Proc. London Math. Soc.}
{\bf 87} (2003), 591--609.

\bibitem{I} A. Ivi\'c,
{\it The Riemann Zeta-Function}, John Wiley and Sons, 1985.

\bibitem{P} S. S. Pillai, On an arithmetic functions,
{\it J. Annamalai Univ.} II (1937), 243--248.

\bibitem{T} K. C. Tong, On divisor problem III, {\it Acta Math. Sinica} {\bf 6} (1956), 515--541.

\bibitem{V}G. Vorono\"{\i},
Sur une fonction transcendante et ses applications a la
sommation de quelques s\'eries, {\it Ann. Sci. \'Ecole Norm Sup.} {\bf 21} (1904), 207--267, 459--533.

\end{thebibliography}


\bigskip
\hrule
\bigskip

\noindent 2000 {\it Mathematics Subject Classification}:
Primary 11N37; Secondary 11M06.

\noindent \emph{Keywords: } gcd-sum function, Dirichlet divisor problem,
mean square estimate.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequence
\seqnum{A018804}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received March 30 2008;
revised version received  May 9 2008.
Published in {\it Journal of Integer Sequences}, June 3 2008.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}


                                                                                


                                                                                

