\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}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}

\DeclareMathOperator{\id}{Id}
\DeclareMathOperator{\re}{Re}
\DeclareMathOperator{\im}{Im}

\newcommand{\N}{\mathbb {N}}
\newcommand{\Z}{\mathbb {Z}}
\newcommand{\R}{\mathbb {R}}
\newcommand{\C}{\mathbb {C}}

\begin{document}

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

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\begin{center}
\vskip 1cm{\LARGE\bf 
An Alternating Sum Involving the Reciprocal of Certain Multiplicative Functions \\
}
\vskip 1cm
\large
Olivier Bordell\`es\\
2, all\'{e}e de la Combe\\
43000 Aiguilhe\\
France\\
\href{mailto:borde43@wanadoo.fr}{\tt borde43@wanadoo.fr} \\
\ \\
Benoit Cloitre\\
19, rue Louise Michel\\
92300 Levallois-Perret\\
France\\
\href{mailto:benoit7848c@yahoo.fr}{\tt benoit7848c@yahoo.fr}
\ \\
\vskip .5in
\textit{\begin{small} \textit{To the memory of Patrick Sargos} \end{small}}
\end{center}

\vskip .2 in
\begin{abstract}
We establish an asymptotic formula for an alternating sum of the reciprocal of a class of multiplicative functions. The proof is straightforward and uses classical convolution techniques. Numerous examples are given.
\end{abstract}


\section{Introduction and main results}
\label{s1}
In 1900, E. Landau \cite{lan} proved that
$$\sum_{n \leq x} \frac{1}{\varphi(n)} = \frac{\zeta(2) \zeta(3)}{\zeta(6)} \left( \log x + \gamma - \sum_p \frac{\log p}{p^2 - p + 1} \right) + O \left( \frac{\log x}{x} \right)$$
where $\varphi$ is the classic Euler totient function and $\gamma$ is Euler's constant, but it seems that in the usual literature there is not any similar result for the alternating sum
$$\sum_{n \leq x} \frac{(-1)^n}{\varphi(n)}.$$
It is fairly easy to show that there exists an absolute constant $c>0$ such that this sum is $> c \, \log x + O(1)$, and therefore the question of an asymptotic formula arises naturally. It should be mentioned that Landau's result could eventually provide such an asymptotic formula via the simple identity
$$\sum_{n \leq x} \frac{(-1)^n}{\varphi(n)} = \sum_{n \leq x} \frac{1}{\varphi(n)} - 2 \sum_{\substack{n \leq x \\ (n,2)=1}} \frac{1}{\varphi(n)}$$
and the use of known estimates as in \cite[Theorem~1]{woo}, but this method does not seem to be easily generalized to a larger class of multiplicative functions than that of \cite{woo}. In this article, we will follow a slightly different approach working with the set of non-zero complex-valued multiplicative functions $f$ satisfying the following assumptions: there exist constants $\lambda_1 >0$ and $0 \leq \lambda_2 < 2$ such that, for each prime power $p^\alpha$, we have
\begin{alignat}{1}
   p^2 \left | \frac{1}{f(p)} - \frac{1}{p} \right | \leq \lambda_1 \quad \text{and} \quad p^{2 \alpha - 1} \left | \frac{1}{f \left( p^\alpha \right)} - \frac{1}{p f \left( p^{\alpha-1} \right)} \right | \leq \lambda_1 \lambda_2^{\alpha - 1} \quad \left( \alpha \geq 2 \right). \label{e1}
\end{alignat}
It will be convenient to set
\begin{alignat}{1}
   \lambda := \frac{\lambda_1(2+\lambda_2)}{2-\lambda_2}. \label{e2}
\end{alignat}
For any prime number $p$, define
\begin{alignat}{1}
   S_f(p) := \sum_{\alpha=1}^{\infty} \frac{1}{f(p^\alpha)} \quad \mathrm{and} \quad s_f(p) := \sum_{\alpha=1}^{\infty} \frac{\alpha}{f(p^\alpha)} \label{e3}
\end{alignat}
and set
\begin{alignat}{1}
   \mathcal{P}_f := \prod_p \left( 1 - \frac{1}{p} \right) \left( 1 + \sum_{\alpha=1}^{\infty} \frac{1}{f(p^\alpha)} \right) \label{e4}
\end{alignat}
where the product is absolutely convergent. 

We are now in a position to state our main result.

\begin{theorem}
\label{t}
Let $f$ be a non-zero multiplicative function satisfying \eqref{e1}. Then, for $x \geq e$, we have
$$\sum_{n \leq x} \frac{(-1)^n}{f(n)} = \frac{S_f(2) -1}{S_f(2) +1} \, \mathcal{P}_f \log x + C_f + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right)$$
where 
$$C_f :=  \frac{S_f(2) -1}{S_f(2) +1} \, \mathcal{P}_f  \left(  \gamma + \sum_p \log p \left( \frac{1}{p-1} - \frac{s_f(p)}{1+S_f(p)} \right)  - \frac{2 s_f(2) \log 2}{S_f(2)^2-1} \right)$$
and $S_f(p)$, $s_f(p)$ and $\mathcal{P}_f$ are given in \eqref{e3} and \eqref{e4}.
\end{theorem}

\begin{corollary}
\label{co1}
Let $f$ be a non-zero multiplicative function satisfying \eqref{e1} and assume that, for any prime $p$ and any integer $\alpha \geq 1$, $f \left( p^\alpha \right) = p^{\alpha - 1} f(p)$. Then, for $x \geq e$, we have
\begin{eqnarray*}
   \sum_{n \leq x} \frac{(-1)^n}{f(n)} &=& \frac{2-f(2)}{2+f(2)} \prod_p \left( 1  - \frac{1}{p} + \frac{1}{f(p)}\right) \left(  \log x + \gamma + \sum_p \frac{\left( f(p) - p\right) \log p}{(p-1)f(p) + p} - \frac{8 f(2) \log 2}{4 - f(2)^2}\right) \\
   & & {} + O \left( \frac{(\log x)^{\lambda_1 + 1}}{x} \right).
\end{eqnarray*}
\end{corollary}

\begin{remark}
\label{re}
If $S_f(2)=1$ in Theorem~\ref{t}, i.e. $f(2)=2$ in Corollary~\ref{co1}, then the constant $C_f$ reduces to
$$C_f = - \mathcal{P}_f \, s_f(2) \, \log \sqrt{2}.$$
\end{remark}

\begin{corollary}
\label{co2}
For $x \geq e$, the following estimates hold.
\begin{enumerate}
   \item[{\rm (i)}]
$$\sum_{n \leq x} \frac{(-1)^n}{\varphi(n)} = \frac{\zeta(2) \zeta(3)}{3 \zeta(6)} \left(  \log x  + \gamma - \sum_{p} \frac{\log p}{p^2-p+1} - \frac{8 \log 2}{3} \right)  + O \left( \frac{(\log x)^3}{x} \right).$$
   \item[{\rm (ii)}] Let $\chi$ be a non-principal Dirichlet character modulo $q > 2$ and $\varphi(n,\chi)$ be the twisted Euler function attached to $\chi$ given in \eqref{e6}. Then
\begin{eqnarray*}
   \sum_{n \leq x} \frac{(-1)^n}{\varphi(n, \chi)} &=& \frac{\chi(2) L(1,\chi)}{4-\chi(2)}  \prod_{p} \left( 1 - \frac{\chi(p)}{p} + \frac{\chi(p)}{p^2} \right) \Biggl (  \log x + \gamma  \\
   & & {} \left. - \sum_p \frac{\chi(p) \log p}{p^2-p \chi(p) + \chi(p)} - \frac{8(2-\chi(2)) \log 2}{\chi(2)(4-\chi(2))} \right) + O \left( \frac{(\log x)^3}{x} \right).
\end{eqnarray*}
   \item[{\rm (iii)}] Let $\Psi$ be the Dedekind arithmetic function defined in \eqref{e5}. Then
   \begin{eqnarray*}
      \sum_{n \leq x} \frac{(-1)^n}{\Psi(n)} &=& - \frac{1}{5} \prod_p \left( 1 - \frac{1}{p(p+1)} \right) \left( \log x  + \gamma + \sum_{p} \frac{\log p}{p^2+p-1} + \frac{24 \log 2}{5} \right) \\
      & & {} + O \left( \frac{(\log x)^2}{x} \right).
   \end{eqnarray*}
   \item[{\rm (iv)}] Let $\gamma(n) := \prod_{p \mid n} p$ be squarefree kernel of $n$. Then
   \begin{eqnarray*}
      \sum_{n \leq x} \frac{(-1)^n \gamma(n)}{\varphi(n)^2} &=& \frac{5}{11} \prod_p \left(  1+ \frac{p^2+p-1}{p(p+1)(p-1)^2} \right) \Biggl ( \log x + \gamma  \\
      & & {} \left. - \sum_p \frac{\left( p^3-2p^2-p+1 \right) \log p}{(p^2-1)(p^4-p^3+2p-1)} - \frac{64 \log 2}{55} \right) + O \left( \frac{(\log x)^7}{x} \right). 
   \end{eqnarray*}
   \item[{\rm (v)}] Let $\sigma$ be the sum-of-divisors function. Then
   \begin{eqnarray*}
      \sum_{n \leq x} \frac{(-1)^n}{\sigma(n)} &=& \frac{S_{\sigma}(2)-1}{S_{\sigma}(2)+1} \prod_p \left(  1-\frac{1}{p} + \frac{(p-1)^2}{p}\sum_{\alpha = 2}^\infty \frac{1}{p^{\alpha}-1} \right) \Biggl ( \log x + \gamma  \\
      & & {} \left. + \sum_p \log p \left( \frac{1}{p-1} - \frac{s_\sigma(p)}{1+S_\sigma(p)} \right)  + \kappa \log 2 \right) + O \left( \frac{(\log x)^4}{x} \right)
   \end{eqnarray*}
where $\kappa \doteq 3.6$. Note that the leading constant is $\doteq - 0.16 \, 468$.
   \item[{\rm (vi)}] Let $\sigma^*$ be the sum-of-unitary-divisors function. Then
   \begin{eqnarray*}
      \sum_{n \leq x} \frac{(-1)^n}{\sigma^*(n)} &=&  \frac{S_{\sigma^*}(2)-1}{S_{\sigma^*}(2)+1} \prod_p \left(  1-\frac{1}{p} + \frac{p-1}{p}\sum_{\alpha = 1}^\infty \frac{1}{p^{\alpha}+1} \right) \Biggl ( \log x + \gamma  \\
      & & {} \left. + \sum_p \log p \left( \frac{1}{p-1} - \frac{s_{\sigma^*}(p)}{1+S_{\sigma^*}(p)} \right)  + \nu \log 2 \right) + O \left( \frac{(\log x)^4}{x} \right)
   \end{eqnarray*}
where $\nu \doteq 8.04$. Note that the leading constant is $\doteq - 0.10 \, 259$.
\end{enumerate}
\end{corollary}  

\section{Notation}
\label{n}

The celebrated M\"{o}bius function is as always denoted by $\mu$, $\id(n)=n$, $\varphi$ is the Euler totient function, $\Psi$ is the Dedekind function defined by
\begin{alignat}{1}
  \Psi(n) = n \prod_{p \mid n} \left( 1 + \frac{1}{p} \right) \label{e5}
\end{alignat}
and, for each fixed non-principal Dirichlet character $\chi$ modulo $q> 2$, the $\chi$-twisted Euler function $\varphi(n,\chi)$ recently introduced in \cite{kac} is defined by
\begin{alignat}{1}
  \varphi(n,\chi) = n \prod_{p \mid n} \left( 1 - \frac{\chi(p)}{p} \right).  \label{e6}
\end{alignat}
For any two arithmetic functions $u$ and $v$, $u \star v$ is the usual Dirichlet convolution product of $u$ and $v$ defined by
$$(u \star v)(n) = \sum_{d \mid n} u(d) v(n/d).$$
The \textit{Eratosthenes transform} of $u$ is the arithmetic function $u \star \mu$. Finally, $f$ is a non-zero multiplicative function satisfying \eqref{e1} and $g$ is the Eratosthenes transform of $\id f^{-1}$. Note that the assumption \eqref{e1} can be written as
\begin{alignat}{1}
   p |g(p)| \leq \lambda_1 \quad \textrm{and} \quad p^{\alpha-1} \left | g \left( p^\alpha \right) \right | \leq \lambda_1 \lambda_2^{\alpha - 1} \quad \left( \alpha \geq 2 \right). \label{e7}
\end{alignat}

\section{Tools}
\label{s2}

\begin{lemma}
\label{le1}
Let $\delta > 0$. The Dirichlet series of the arithmetic function $g(n)$ is absolutely convergent in the half-plane $\sigma > \delta$.
\end{lemma}

\begin{proof}
Let $s = \delta + it \in \C$ with $\delta > 0$. The function $g$ is multiplicative and using \eqref{e7} we get for all $z \geq e$
\begin{eqnarray*}
   \sum_{p \leq z} \sum_{\alpha = 1}^\infty \left | \frac{g \left( p^\alpha \right)}{p^{s \alpha}} \right |  &=& \sum_{p \leq z} \left( \frac{|g(p)|}{p^\delta} + \sum_{\alpha = 2}^\infty \left | \frac{g \left( p^\alpha \right)}{p^{s \alpha}} \right | \right) \\
   & \leq & \lambda_1 \left( \sum_{p \leq z} \frac{1}{p^{\delta+1}} + \sum_{p \leq z} \frac{1}{p^\delta} \sum_{\alpha = 2}^\infty \left( \frac{\lambda_2}{p^{\delta +1}} \right)^{\alpha-1} \right) \\
   &=& \lambda_1 \sum_{p \leq z} \left( \frac{1}{p^{\delta+1}} + \frac{\lambda_2}{p^{\delta} (p^{\delta+1} - \lambda_2)} \right) \\
   & \leq & \lambda_1 \sum_{p \leq z} \left( \frac{1}{p^{\delta+1}} + \frac{2\lambda_2}{p^{\delta} (2 - \lambda_2)} \, \frac{1}{p^{\delta+1}} \right) \\
   & \leq & \lambda \sum_{p \leq z} \frac{1}{p^{\delta+1}}
\end{eqnarray*}
where we used the inequality
$$\frac{1}{p^\theta - \lambda_2} \leq \frac{2}{2-\lambda_2} \, \frac{1}{p^\theta} \quad \left( \theta \geq 1 \right).$$
This implies the asserted result.
\end{proof}

\begin{lemma}
\label{le2}
For all real numbers $z \geq e$ and $a \in \{0,1 \}$
\begin{eqnarray*}
   \mathrm{(i)} &:& \sum_{n \leq z} |g(n)| \ll \left( \log z \right)^{\lambda}. \\
   & & \\  
   \mathrm{(ii)} &:& \sum_{n > z} \frac{|g(n)| (\log n)^a}{n} \ll z^{-1} \left( \log z \right)^{\lambda + a}.
\end{eqnarray*}
\end{lemma}

\begin{proof}
\begin{enumerate}
   \item[]
   \item[{\rm (i)}] As in the proof of Lemma~\ref{le1},  we get for all $z \geq e$
\begin{eqnarray*}
   \sum_{n \leq z} |g(n)| & \leq & \exp  \left\{ \sum_{p \leq z} |g(p)| + \sum_{p \leq z} \sum_{\alpha = 2}^\infty \left | g \left( p^\alpha \right) \right | \right\} \\
   & \leq & \exp \left\lbrace \lambda_1 \left(  \sum_{p \leq z} \frac{1}{p} +  \sum_{p \leq z} \sum_{\alpha = 2}^\infty \left( \frac{\lambda_2}{p} \right)^{\alpha - 1} \right) \right\rbrace \\
   & \leq & \exp \left\lbrace \lambda_1 \left(  \sum_{p \leq z} \frac{1}{p} +  \frac{2 \lambda_2}{2-\lambda_2} \sum_{p \leq z} \frac{1}{p} \right) \right\rbrace \\
   & = & \exp  \left(  \lambda \sum_{p \leq z} \frac{1}{p} \right)  \ll (\log z)^{\lambda}
\end{eqnarray*}
as asserted.
   \item[{\rm (ii)}] Follows from Lemma~\ref{le1},~(i) and partial summation. We leave the details to the reader. \\
\end{enumerate}
The proof is complete.
\end{proof}

\begin{lemma}
\label{le3}
For any real number $x \geq 1$ and any integer $1 \leq d \leq 2x$, we have
$$\sum_{\substack{n \leq x \\ d \mid 2n}} \frac{1}{n} = \frac{\rho(d)}{d} \left( \log \frac{\rho(d) x}{d} + \gamma \right) + O \left( \frac{1}{x} \right)$$
where
\begin{equation}
   \rho(d) := 
   \begin{cases} 2, & \text{if  $d$ is even; } \\
   1 , & \text{if  $d$ is odd}. 
   \end{cases}
   \label{e8}
\end{equation}
\end{lemma}

\begin{proof}
Let $S(x,d)$ be the sum of the left-hand side. If $x < d \leq 2x$, then
$$S(x,d) = \frac{2}{d} < \frac{2}{x}.$$
If $d \leq x$ is odd, then by Gauss's theorem we have 
$$S(x,d) = \sum_{\substack{n \leq x \\ d \mid n}} \frac{1}{n} = \frac{1}{d} \sum_{1 \leq k \leq x/d} \frac{1}{k} = \frac{1}{d} \left( \log \frac{x}{d} + \gamma + O \left( \frac{d}{x} \right) \right)$$
as required. \\
\item[]
Now assume that $d$ is even. If $\frac{2x}{3} < d \leq x$, then $\frac{x}{d} - \frac{1}{2} < 1$ and therefore
\begin{eqnarray*}
   S(x,d) &=& \sum_{\substack{n \leq x \\ d \mid n}} \frac{1}{n} + \sum_{\substack{n \leq x \\ n \equiv d/2 \  (\textrm{mod} \, d)}} \frac{1}{n} \\
   &=& \frac{1}{d} \sum_{1 \leq k \leq x/d} \frac{1}{k} + \frac{1}{d} \sum_{0 \leq k \leq x/d-1/2} \frac{1}{k+1/2} \\
   &=& \frac{1}{d} \left( \log \frac{x}{d} + \gamma + O \left( \frac{d}{x} \right) \right) + \frac{2}{d} \\
   &=& \frac{1}{d} \left( \log \frac{x}{d} + \gamma \right)  + O \left( \frac{1}{x} \right) 
\end{eqnarray*}
since the assumption $d > \frac{2x}{3}$ implies $\frac{2}{d} < \frac{3}{x}$. On the other hand, since $1 \leq \frac{x}{d} < \frac{3}{2}$, we have
$$\left | \frac{2}{d} \log \frac{2x}{d} + \frac{\gamma}{d} - \frac{1}{d} \log \frac{x}{d} \right | \leq \frac{1}{d} \left( \log \frac{4x}{d} + \gamma \right) < \frac{\log 6 + \gamma}{d} < \frac{3 \left( \log 6 + \gamma \right)}{2x}$$
and thus in this case we also get
$$S(x,d) =  \frac{2}{d} \left( \log \frac{2x}{d} + \gamma \right)  + O \left( \frac{1}{x} \right).$$
If $1 \leq d \leq \frac{2x}{3}$, since
$$\sum_{1 \leq k \leq x/d-1/2} \frac{1}{k+1/2} = \log \frac{x}{d} +  \gamma - 2 + \log 4 +  O \left( \frac{d}{x} \right)$$
where we used the fact that $d \leq \frac{2x}{3}$ implies $\frac{x}{d} - \frac{1}{2} \geq \frac{2x}{3d}$, then
\begin{eqnarray*}
   S(x,d) &=& \frac{1}{d} \left( \log \frac{x}{d} + \gamma + O \left( \frac{d}{x} \right) \right) + \frac{2}{d} \\
   & & {} + \frac{1}{d} \left( \log \frac{x}{d} +  \gamma - 2 + \log 4 +  O \left( \frac{d}{x} \right) \right) \\
   &=& \frac{2}{d} \left( \log \frac{2x}{d} + \gamma \right)  + O \left( \frac{1}{x} \right) 
\end{eqnarray*}
completing the proof.
\end{proof}

\section{Sums of reciprocals}
\label{s3}

\begin{lemma}
\label{le4}
Let $f$ satisfying the conditions \eqref{e1}. Then
$$\sum_{n \leq x} \frac{1}{f(n)} = \log x \sum_{d = 1}^{\infty} \frac{g(d)}{d} + K_f + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right)$$
where
\begin{alignat}{1}
   K_f := \sum_{d=1}^\infty \frac{g(d)}{d} \left( \gamma - \log d \right) \label{e9}
\end{alignat}
and
$$\sum_{\substack{n \leq 2x \\ n \, \mathrm{even}}} \frac{1}{f(n)} = \frac{\log x}{2} \sum_{d = 1}^{\infty} \frac{g(d) \rho(d)}{d} + L_f + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right)$$
where
\begin{alignat}{1}
   L_f := \frac{1}{2} \sum_{d=1}^\infty \frac{g(d) \rho(d)}{d} \left( \gamma + \log \frac{\rho(d)}{d} \right). \label{e10}
\end{alignat}
and where $\rho(d)$ is given in \eqref{e8} and $\lambda$ is defined in \eqref{e2}.
\end{lemma}

\begin{proof}
The proof of the first estimate follows the classical lines. We have
\begin{eqnarray*}
   \sum_{n \leq x} \frac{1}{f(n)} &=& \sum_{n \leq x} \frac{(g \star \mathbf{1})(n)}{n} = \sum_{n \leq x} \frac{1}{n} \sum_{d \mid n} g(d) \\
   &=& \sum_{d \leq x} \frac{g(d)}{d} \sum_{k \leq x/d} \frac{1}{k} \\
   &=& \sum_{d \leq x} \frac{g(d)}{d} \left( \log \frac{x}{d} + \gamma + O \left( \frac{d}{x} \right) \right) \\
   &=& (\log x + \gamma) \sum_{d \leq x} \frac{g(d)}{d} - \sum_{d \leq x} \frac{g(d) \log d}{d}+ O \left( \frac{1}{x} \sum_{d \leq x} |g(d)| \right) \\
\end{eqnarray*}
and by Lemma~\ref{le2} we get
$$\sum_{n \leq x} \frac{1}{f(n)} = ( \log x + \gamma ) \sum_{d = 1}^{\infty} \frac{g(d) \rho(d)}{d} - \sum_{d = 1}^{\infty} \frac{g(d) \log(d)}{d} + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right)$$
as asserted. \\
\item[]
The second estimate is similar, with the additional use of Lemma~\ref{le3} which gives
\begin{eqnarray*}
   \sum_{\substack{n \leq 2x \\ n \, \textrm{even}}} \frac{1}{f(n)} &=& \sum_{n \leq x} \frac{1}{f(2n)} = \sum_{n \leq x} \frac{(g \star \mathbf{1})(2n)}{2n} \\
   &=& \frac{1}{2} \sum_{n \leq x} \frac{1}{n} \sum_{d \mid 2n} g(d) = \frac{1}{2} \sum_{d \leq 2x} g(d) \sum_{ \substack{n \leq x \\ d \mid 2n}} \frac{1}{n} 
   \end{eqnarray*}
   \begin{eqnarray*}
   &=& \frac{1}{2} \sum_{d \leq 2x} g(d) \left( \frac{\rho(d)}{d} \left( \log \frac{\rho(d) x}{d} + \gamma \right) + O \left( \frac{1}{x} \right) \right) \\
   &=& \frac{1}{2} ( \log x + \gamma ) \sum_{d \leq 2x} \frac{g(d) \rho(d)}{d} + \frac{1}{2} \sum_{d \leq 2x} \frac{g(d) \rho(d)}{d} \log \frac{\rho(d)}{d} \\
   & & {} + O \left( \frac{1}{x} \sum_{d \leq 2x} |g(d)| \right) \\
   &=&  \frac{1}{2} ( \log x + \gamma ) \sum_{d = 1}^{\infty} \frac{g(d) \rho(d)}{d} - \frac{1}{2} ( \log x + \gamma ) \sum_{d > 2x}^{\infty} \frac{g(d) \rho(d)}{d}  \\
   & & {} + \frac{1}{2} \sum_{d=1}^{\infty} \frac{g(d) \rho(d)}{d} \log \frac{\rho(d)}{d} - \frac{1}{2} \sum_{d > 2x} \frac{g(d) \rho(d)}{d} \log \frac{\rho(d)}{d} \\
   & & {} + O \left( \frac{1}{x} \sum_{d \leq 2x} |g(d)| \right)
\end{eqnarray*}
and by Lemma~\ref{le2} we get
$$\sum_{\substack{n \leq 2x \\ n \, \textrm{even}}} \frac{1}{f(n)} = \frac{1}{2} ( \log x + \gamma ) \sum_{d = 1}^{\infty} \frac{g(d) \rho(d)}{d} + \frac{1}{2} \sum_{d = 1}^{\infty} \frac{g(d) \rho(d)}{d} \log \frac{\rho(d)}{d} + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right)$$
completing the proof.
\end{proof}

\section{Proof of Theorem~\ref{t}}
\label{s4}

\subsection{First step: Asymptotic formula}

From Lemma~\ref{le4} we get
\begin{eqnarray*}
   \sum_{n \leq x} \frac{(-1)^n}{f(n)} &=& 2 \sum_{\substack{n \leq x \\ n \, \textrm{even}}} \frac{1}{f(n)} - \sum_{n \leq x} \frac{1}{f(n)} \\
   &=& \log \frac{x}{2} \sum_{d = 1}^{\infty} \frac{g(d) \rho(d)}{d} - \log x \sum_{d = 1}^{\infty} \frac{g(d)}{d} + 2L_f - K_f \\
   & & {} + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right) \\
\end{eqnarray*}
where $K_f$ et $L_f$ are given in \eqref{e9} et \eqref{e10}, so that setting
\begin{eqnarray*}
   C_f &:=& 2L_f - K_f - \log 2  \sum_{d = 1}^{\infty} \frac{g(d)}{d} \\
   &=&  \sum_{d = 1}^{\infty} \frac{g(d)}{d} \left( \left( \rho(d) - 1 \right) \left( \gamma - \log d \right) + \rho(d) \log \frac{\rho(d)}{2} \right)  \\
   &=& \sum_{\substack{d = 1 \\ d \ \textrm{even}}}^{\infty} \frac{g(d)}{d} \left( \gamma - \log d \right) +  \sum_{\substack{d = 1 \\ d \ \textrm{odd}}}^{\infty} \frac{g(d) \rho(d)}{d} \log \frac{\rho(d)}{2}  \\
   &=& \sum_{d = 1}^{\infty} \frac{g(2d)}{2d} \left( \gamma - \log 2d \right) - \log 2 \sum_{\substack{d = 1 \\ d \ \textrm{odd}}}^{\infty} \frac{g(d)}{d} \\
   &=& \frac{1}{2} \sum_{d = 1}^{\infty} \frac{g(2d)}{d} \left( \gamma - \log d \right) - \log 2 \sum_{d = 1}^{\infty} \frac{g(d)}{d} \\
\end{eqnarray*}
we obtain
\begin{eqnarray*}
   \sum_{n \leq x} \frac{(-1)^n}{f(n)} &=& \log x \sum_{d = 1}^{\infty} \frac{g(d) \left( \rho(d) - 1 \right)}{d} + C_f + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right) \\
   &=& \frac{\log x}{2} \sum_{d = 1}^{\infty} \frac{g(2d)}{d} + C_f + O \left( \frac{(\log x)^{\lambda + 1}}{x} \right)
\end{eqnarray*}
completing the proof.
\qed

\subsection{Second step: Series expansions}

\noindent
The unique decomposition $d= 2^\alpha m$ with $\alpha \in \Z^+$ and $m \geq 1$ odd provides
\begin{eqnarray*}
   \sum_{d=1}^\infty \frac{g(d)}{d} &=& \sum_{\alpha = 0}^\infty \frac{g(2^\alpha) }{2^\alpha} \sum_{\substack{m=1 \\ m \ \textrm{odd}}}^\infty \frac{g(m)}{m} \\
   &=& \left( 1 +  \sum_{\alpha = 1}^\infty \frac{g(2^\alpha) }{2^\alpha} \right) \prod_{p \geq 3} \left( 1 + \sum_{\alpha = 1}^\infty \frac{g(p^\alpha) }{p^\alpha} \right) \\
   &=& \frac{1}{2} \sum_{\alpha = 0}^\infty \frac{1}{f(2^\alpha)}  \prod_{p \geq 3} \left( 1 - \frac{1}{p} \right) \left( 1 + \sum_{\alpha = 1}^\infty \frac{1}{f (p^\alpha)} \right) \\
   &=& \mathcal{P}_f
\end{eqnarray*}
and
\begin{eqnarray*}
   \sum_{d=1}^\infty \frac{g(2d)}{d} &=& \sum_{\alpha = 0}^\infty \frac{g \left( 2^{\alpha+1} \right)}{2^\alpha} \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m)}{m} \\
   &=& \left( g(2) + 2 \sum_{\alpha = 2}^\infty \frac{g \left( 2^{\alpha} \right)}{2^\alpha} \right) \prod_{p \geq 3} \left( 1 + \sum_{\alpha=1}^{\infty} \frac{g \left( p^\alpha \right)}{p^\alpha} \right) \\
   &=& \left( \sum_{\alpha=1}^\infty \frac{1}{f \left( 2^\alpha \right)} -1 \right) \prod_{p \geq 3} \left( 1-\frac{1}{p} \right) \left( 1 + \sum_{\alpha = 1}^\infty \frac{1}{f \left( p^\alpha \right)} \right) \\
   &=& \frac{2\left( S_f(2)-1\right) }{S_f(2)+1} \mathcal{P}_f.
\end{eqnarray*}
Similarly
\begin{eqnarray*}
   \sum_{d=1}^\infty \frac{g(2d) \log d}{d} &=& \sum_{\alpha = 0}^\infty \frac{g \left( 2^{\alpha+1} \right)}{2^\alpha} \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log (2^\alpha m)}{m} \\
   &=& \sum_{\alpha = 0}^\infty \frac{g \left( 2^{\alpha+1} \right)}{2^\alpha} \left( \alpha \log 2 \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m)}{m} + \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log m}{m} \right) \\
   &=& \log 2 \sum_{\alpha = 0}^\infty \frac{\alpha g \left( 2^{\alpha+1} \right)}{2^\alpha} \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m)}{m} + \sum_{\alpha = 0}^\infty \frac{g \left( 2^{\alpha+1} \right)}{2^\alpha} \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log m}{m} \\
   &=& \log 2 \left( \sum_{\alpha=1}^\infty \frac{\alpha - 2}{f \left( 2^\alpha \right)} \right) \prod_{p \geq 3} \left( 1-\frac{1}{p} \right) \left( 1 + \sum_{\alpha = 1}^\infty \frac{1}{f \left( p^\alpha \right)} \right) \\
   & & {} + \left( \sum_{\alpha=1}^\infty \frac{1}{f \left( 2^\alpha \right)} -1 \right) \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log m}{m} \\
   &=& \frac{2 \log 2 \left( s_f(2)-2S_f(2) \right)}{S_f(2)+1} \mathcal{P}_f + \left( S_f(2) - 1 \right) \sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log m}{m}.  \\
\end{eqnarray*}
Now since for $s \in \C$ such that $\re s > \delta > 0$, we have
$$\sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m)}{m^s} = \prod_{p \geq 3} \left( 1 - \frac{1}{p^s} \right) \left( 1 + \sum_{\alpha = 1}^{\infty} \frac{1}{p^{\alpha(s-1)} f(p^\alpha)} \right) := G(s)$$
we infer
$$\sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log m}{m} = - G'(1).$$
Using the logarithmic derivative, we get
$$\frac{G'_f(s)}{G(s)} = \sum_{p \geq 3} \log p \left( \frac{1}{p^s-1} - \frac{\sum_{\alpha=1}^{\infty} \frac{\alpha}{{p^{\alpha(s-1)} f(p^\alpha)}}}{1 + \sum_{\alpha = 1}^{\infty} \frac{1}{p^{\alpha(s-1)} f(p^\alpha)}} \right) $$
and therefore
$$\sum_{\substack{m=1 \\ m \, \textrm{odd}}}^{\infty} \frac{g(m) \log m}{m} = - \frac{2 \mathcal{P}_f}{S_f(2)+1} \sum_{p \geq 3} \log p \left( \frac{1}{p-1} - \frac{s_f(p)}{1 + S_f(p)} \right)$$
thus completing the proof of Theorem~\ref{t}.
\qed

\section{Acknowledgments}
We express our gratitude to the referee for his careful reading of the manuscript and the many valuable suggestions and corrections he made.

\begin{thebibliography}{9}

\bibitem{kac} J. Kaczorowski and K. Wiertelak, On the sum of the
twisted Euler function, \textit{Internat. J. Number Theory} \textbf{8}
(2012), 1741--1761.

\bibitem{lan} E. Landau, \"{U}ber die Zahlentheoretische Function
$\varphi(n)$ und ihre Beziehung zum Goldbachschen Satz,
\textit{Nachrichten der Koniglichten Gesellschaft der Wissenschaften zu
G\"{o}ttingen, Mathematisch-Physikalische Klasse}, 1900,
177--186.  

\bibitem{woo} K. Wooldridge, Mean value theorems for arithmetic functions similar to Euler's phi-function, \textit{Proc. Amer. Math. Soc.} \textbf{58} (1976), 73--78.

\end{thebibliography}

\bigskip
\hrule
\bigskip

\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11A25; Secondary 11N37.

\noindent \emph{Keywords: } alternating sum, 
average order over a polynomial sequence.

\bigskip
\hrule
\bigskip

\noindent
(Concerned with sequences 
\seqnum{A001615},
\seqnum{A058026},
\seqnum{A065463},
\seqnum{A082695},
\seqnum{A211117}, and
\seqnum{A211178}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received February 9 2013; revised versions received March 3 2013; June 12 2013.
Published in {\it Journal of Integer Sequences}, June 16 2013.

\bigskip
\hrule
\bigskip

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

\end{document}

                                                                                


                                                                                


.
