\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://oeis.org/#1}{\underline{#1}}}

\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 Exponential Sums Involving the $k$-th Largest \\
\vskip .1in
Prime Factor Function
}
\vskip 1cm
\large
Jean-Marie~De~Koninck \\
D\'epartement de Math\'ematiques \\
Universit\'e Laval \\
Qu\'ebec G1V 0A6 \\
Canada \\
\href{mailto:jmdk@mat.ulaval.ca}{\tt jmdk@mat.ulaval.ca} \\
\ \\
Imre K\'atai\\
Computer Algebra Department\\
E\"otv\"os Lor\'and University \\
1117 Budapest\\
P\'azm\'any P\'eter S\'et\'any I/C \\
Hungary  \\
\href{mailto:katai@compalg.inf.elte.hu}{\tt katai@compalg.inf.elte.hu} \\
\end{center}

\vskip .2 in


\def\N{{\mathbb N}}
\def\Z{{\mathbb Z}}
\def\R{{\mathbb R}}
\def\C{{\mathbb C}}
\def\Q{{\mathbb Q}}


\centerline{\it Dedicated to Jean-Paul Allouche on the occasion of his $60^{th}$ birthday}

\begin{abstract}
 Letting $P_k(n)$ stand for the $k$-th largest prime factor of $n\ge 2$ and given an irrational number $\alpha$ and   a multiplicative function $f$ such that $|f(n)|=1$ for all positive integers $n$, we prove that $\sum_{n\le x} f(n)
 \exp\{2\pi i \alpha P_k(n)\}=o(x)$ as $x\to \infty$.
\end{abstract}

\section{Introduction}

In 1954, Vinogradov \cite{kn:vin} showed that, given any irrational number $\alpha$, if $p_1<p_2<\cdots$ stands for the sequence of primes, then
\begin{equation} \label{eq:vin}
 \sum_{n\le x} e(\alpha p_n) =o(x) \qquad \mbox{as } x\to \infty,
\end{equation}
where we used the standard notation $e(z)=\exp\{2\pi i z\}$. In light of the well known Weyl criteria (see the book of Kuipers and Niederreiter \cite{kn:kui}), statement (\ref{eq:vin}) is equivalent to asserting that
the sequence
$\alpha p_n$, $n=1,2,\ldots$, is uniformly distributed mod\,1.

In 2005, Banks, Harman and Shparlinski \cite{kn:banks}
proved that for every irrational number $\alpha$,
\begin{equation} \label{eq:aa}
 \sum_{n\le x} e(\alpha P(n)) =o(x) \qquad \mbox{as } x\to \infty,
\end{equation}
where $P(n)$ stands for the largest prime factor of the integer $n\ge
2$ with $P(1)=1$.

Let ${\cal M}$ denote the set of all complex valued
multiplicative arithmetical functions and let ${\cal M}_1$ be those $f\in {\cal M}$ for which $|f(n)|=1$ for all positive integers $n$.
In \cite{kn:largest}, we  generalized (\ref{eq:aa}) by showing that for any irrational number $\alpha$ and any function $f\in {\cal M}_1$, we have $\sum_{n\le x} f(n)e(\alpha P(n))=o(x)$ as $x\to \infty$.

Let $\omega(n)$ stand for the number of distinct prime divisors of $n\ge 2$ with $\omega(1)=0$.
Given an integer $k\ge 1$, for each integer $n\ge 2$, we let $P_k(n)$ stand for the $k$-th largest prime factor of $n$ if $\omega(n)\ge k$, while we set $P_k(n)=1$ if $\omega(n)\le k-1$. Thus, if $n=p_1^{\alpha_1} p_2^{\alpha_2} \cdots p_s^{\alpha_s}$ stands for the prime factorization of $n$, where $p_1<p_2<\cdots<p_s$, then
$$P_1(n)=P(n)=p_s,\qquad P_2(n)=p_{s-1}, \qquad P_3(n)=p_{s-2}, \ldots$$

In this paper,  we prove that, given any integer $k\ge 2$ and any irrational number $\alpha$, then
$\displaystyle{\sum_{n \le x} f(n) e(\alpha P_k(n))=o(x)}$  as $x\to \infty$.


\section{Main result}

\begin{theorem}
Given an integer $k\ge 2$ and an irrational number $\alpha$, let $f\in {\cal M}_1$ and consider the sum
$$S_f(x) = \sum_{n \le x} f(n) e(\alpha P_k(n)).$$
Then
\begin{equation} \label{eq:*}
S_f(x) =o(x) \qquad \mbox{as } x\to \infty.
\end{equation}
\label{main}
\end{theorem}

\section{Notation and preliminary results}

We say that a function $L:\R^+\to \R^+$ is slowly oscillating if $\lim_{y\to \infty} L(cy)/L(y)$ for each real number $c>0$.

In 1968, Hal\'asz \cite{kn:hal}  established the following result.
\begin{lemma}[Hal\'asz's theorem] \label{lem:1}
Let $f$ be a complex-valued multiplicative arithmetical function such that $|f(n)|\le 1$ for all positive integers $n$. The following two statements hold:
\begin{enumerate}
\item[(a)] If there exists a real number $\tau_0$ for which the series
$$ \sum_p \frac{1-\Re(f(p)/p^{i\tau_0})}p  $$
is convergent, then, as $x\to \infty$,
$$\sum_{n\le x} f(n) = x \cdot \frac{x^{i\tau_0}}{1+\i \tau_0} \prod_{p\le x} \left(1-\frac 1p \right) \left(1+ \sum_{r=1}^\infty \frac{f(p^r)}{p^{r(1+i\tau_0)}} \right) +o(x).$$
\item[(b)] If the series
$$ \sum_p \frac{1-\Re(f(p)/p^{i\tau})}p  $$
is divergent for every real number $\tau$, then
$$\sum_{n\le x} f(n) = o(x) \qquad \mbox{as } x\to \infty.$$
\end{enumerate}
\end{lemma}

\begin{proof}
For a proof, see the book of Schwarz and Spilker (\cite[Thm.\ 3.1]{kn:spilker}).
\end{proof}


Fix an integer $k\ge 2$ and for each real number $\tau$, let
$$R_\tau(x) := \sum_{n \le x} f(n)n^{i\tau} e(\alpha P_k(n)).$$
We then have the following result.

\begin{lemma} \label{lem:2}
Let $\tau_1,\tau_2\in \R$. Then, as  $x\to \infty$,
\begin{equation} \label{eq:lim}
\mbox{(a)}\quad R_{\tau_1}(x) =o(x) \qquad \Longleftrightarrow \qquad \mbox{(b)}\quad R_{\tau_2}(x) =o(x).
\end{equation}
\begin{proof}
It is clear that (a) holds if and only if, given any $\varepsilon>0$,
$$\frac 1{\varepsilon x} \sum_{x\le n \le (1+\varepsilon) x} f(n) n^{i\tau_1} e(\alpha P_k(n)) \to 0\quad \mbox{ as } x\to \infty,$$
while (b) holds if and only if, given any $\varepsilon>0$,
$$\frac 1{\varepsilon x} \sum_{x\le n \le (1+\varepsilon) x} f(n) n^{i\tau_2} e(\alpha P_k(n)) \to 0\quad \mbox{ as } x\to \infty.$$ But since each $n\in [x,(1+\varepsilon) x]$ can be written as $n=x+\delta x$ for some $0\le \delta \le \varepsilon$, we have $$n^{i\tau_2}=(x+ \delta x)^{i\tau_2}= x^{i\tau_2} \left( 1 + \delta  \right)^{i\tau_2} = x^{i\tau_2} (1+ O(\varepsilon)),$$
and similarly
$$n^{i\tau_1}= x^{i\tau_1} (1+ O(\varepsilon)).$$
It follows that (a) and (b) are equivalent, thus proving (\ref{eq:lim}).
\end{proof}

\end{lemma}

\begin{lemma} \label{lem:2a}
For all $2\le y \le x$, let $\Psi(x,y):=\#\{n\le x: P(n)\le y\}$. Then,
\begin{enumerate}
\item[(a)] As $x\to \infty$,
$$\Psi(x,y) = (1+o(1))\rho(u)\,x,$$
where $u=\log x/\log y$ and $\rho(u)$ is the Dickman function defined by the initial condition $\rho(u)=1$ for $0\le u \le 1$ and thereafter as the continuous solution of the differential equation with shift differences
$$u\rho'(u)+\rho(u-1)=0 \qquad (u>1).$$
\item[(b)] For all $2\le y \le x$, $\displaystyle{\Psi(x,y) \ll x \exp\left\{ - \frac 12 \frac{\log x}{\log y} \right\}}$.
\end{enumerate}
\end{lemma}

\begin{proof}
Proofs of these results can be found in the book of De Koninck and Luca (\cite{kn:book}, pages 134 and 138).
\end{proof}

\begin{lemma} \label{lem:3}
Given an arbitrary irrational number $\alpha$, set
$$S_1(x)=\sum_{n\le x} e(\alpha P_k(n)).$$
Then
$$S_1(x) =o(x) \qquad \mbox{as } x \to \infty.$$
\end{lemma}

\begin{proof}
Let $\varepsilon>0$ be a small number.
It is easy to see that in the sum representing $S_1(x)$, we may drop three types of integers $n\le x$, namely (i) those for which $\omega(n)\le k+1$, (ii) those for which $P_{k+1}(n) \le x^\varepsilon$ and finally (iii) those for which $p^2|n$ for some prime $p\ge P_k(n)$, the reason being that the number of these exceptional $n$'s is $O(\varepsilon x)$. So, let us write the remaining integers $n\le x$ as
$$n = \nu p_k p_{k-1} \cdots p_1, \quad \mbox{where } x^\varepsilon < P(\nu)< p_k <p_{k-1}< \cdots <p_1$$
and set
$$Q_k=p_kp_{k-1} \cdots p_1 \ (<x^{1-\varepsilon}).$$
Using this set up, we may write
$$
S_1(x) = \sum_{x^\varepsilon <p_k <\cdots <p_1 \atop Q_k <x^{1-\varepsilon}} e(\alpha p_k) \Psi\left( \frac x{Q_k}, p_k \right) +O(\varepsilon x).
$$
Let
$$T_1(x) = \sum_{x^\varepsilon <p_k <\cdots <p_1 \atop Q_k <x^{1-\varepsilon}} e(\alpha p_k) \Psi\left( \frac x{Q_k}, p_k \right),$$
so that
\begin{equation} \label{eq:B1}
S_1(x) =  T_1(x) + O(\varepsilon x),
\end{equation}
Now, observe that,
using Lemma \ref{lem:2a} and the fact that $Q_k=p_kQ_{k-1}$, we have
\begin{eqnarray*}
\Psi\left( \frac x{Q_k}, p_k \right) & = &  \frac x{Q_k} \rho \left( \frac{\log x - \log Q_k}{\log p_k}  \right) +o\left( \frac x{Q_k} \right)\\
& = & \frac x{Q_k} \rho \left( \frac{\log x - \log Q_{k-1}}{\log p_k} -1  \right) +o\left( \frac x{Q_k} \right).
\end{eqnarray*}
Substituting this last identity in (\ref{eq:B1}), we get
\begin{eqnarray} \label{eq:S1} \nonumber
T_1(x) & = &  \sum_{x^\varepsilon <p_k <\cdots <p_1  \atop p_kQ_{k-1} < x^{1-\varepsilon}} e(\alpha p_k)  \frac x{Q_k} \rho \left( \frac{\log x - \log Q_{k-1}}{\log p_k} -1  \right) +o(x) \\ \nonumber
& = & \sum_{x^\varepsilon <p_k <\cdots <p_1  \atop p_kQ_{k-1} < x^{1-\varepsilon}} \frac x{Q_{k-1}} \sum_{x^\varepsilon < p_k < \min\left(p_{k-1}, \frac{x^{1-\varepsilon}}{Q_{k-1}} \right)} \frac{e(\alpha p_k)}{p_k}  \rho \left( \frac{\log x - \log Q_{k-1}}{\log p_k} -1  \right)\\
& & \qquad \qquad \qquad  + \quad o(x).
\end{eqnarray}
Setting $\displaystyle{t(p_{k-1},\ldots,p_1):=\min\left(p_{k-1}, \frac{x^{1-\varepsilon}}{Q_{k-1}} \right)}$, we now subdivide the above inner sum
into two separate sums, depending if
$$t(p_{k-1},\ldots,p_1)\le 2x^\varepsilon \quad \mbox{or} \quad  t(p_{k-1},\ldots,p_1)>2x^\varepsilon,$$
and thus we  write $T_1(x)=T_1'(x) + T_1''(x)$.

On the one hand, using the fact that $\displaystyle{ \sum_{x^\varepsilon < p_k \le 2x^\varepsilon} \frac 1{p_k} \ll \frac 1{\varepsilon \log x}}$, we obtain
\begin{equation} \label{eq:a1}
\left| T_1'(x) \right|  \ll \frac{x}{\varepsilon \log x} \left( \sum_{x^\varepsilon < p_k \le 2x^\varepsilon} \frac 1{p_k}  \right)^k \ll_\varepsilon \frac x{\log x}.
\end{equation}
On the other hand,
using the Vinogradov theorem (see (\ref{eq:vin})) and the continuity of the $\rho$ function,
we obtain that, as $x\to \infty$,
\begin{eqnarray} \label{eq:a2} \nonumber
\left| T_1''(x) \right| & \le & \sum_{x^\varepsilon <p_k <t(p_{k-1},\ldots,p_1)} \frac{e(\alpha p_k)}{p_k}
\rho \left( \frac{\log x - \log Q_{k-1}}{\log p_k} -1  \right)\\ \nonumber
& = & o\left( \sum_{x^\varepsilon <p_k <t(p_{k-1},\ldots,p_1)} \frac 1{p_k}
\rho \left( \frac{\log x - \log Q_{k-1}}{\log p_k} -1  \right) \right)\\
& = & o(x).
\end{eqnarray}
Substituting (\ref{eq:a1}) and (\ref{eq:a2}) in (\ref{eq:S1}), and thus in light of  (\ref{eq:B1}) completes the proof of  Lemma \ref{lem:3}.

\end{proof}


\section{Proof of Theorem~\ref{main}}

Let us first assume (case (b) of Hal\'asz's theorem) that
$$\sum_p \frac{1- \Re(f(p)p^{i\tau})}p = \infty \quad \mbox{for all } \tau\in \R.$$
Let us set
$$E(x) =\sum_{n\le x} f(n) \qquad \mbox{and} \qquad E(x|y) = \sum_{n\le x\atop P(n)\le y} f(n).$$
It follows from Hal\'asz's theorem (Lemma \ref{lem:1}) that $E(x)=o(x)$ as $x\to \infty$, in which case there exists a positive decreasing function $\delta(x)$ which tends to 0 as $x\to \infty$ and for which we have
\begin{equation} \label{eq:oubli}
|E(x)| \le x\delta(x) .
\end{equation}
Let $\varepsilon>0$ be a fixed small number and choose $y$ satisfying $x^\varepsilon \le y \le x$. Further set $\Pi_y:= \prod_{y\le p \le x} p$. We then have
\begin{eqnarray*}
E(x|y) & = & \sum_{n\le x} f(n) \sum_{d|(n,\Pi_y)} \mu(d) = \sum_{d|\Pi_y} \mu(d) \sum_{md\le x} f(md) \\
 & = & \sum_{d|\Pi_y} \mu(d) f(d) \sum_{m\le x/d} f(m) + O \left(  \sum_{dm\le x \atop{d|\Pi_y \atop (d,m)>1}} 1 \right)  \\
 & = & \sum_{d|\Pi_y} \mu(d) f(d) E(x/d) +O \left( x \sum_{p>y} \frac 1{p^2} \right).
 \end{eqnarray*}
Consequently, uniformly for $x^\varepsilon \le y \le x$, and in light of (\ref{eq:oubli}), we have
\begin{equation} \label{eq:E}
  |E(x|y)| \le x \sum_{d|\Pi_y} \frac{\delta(x/d)}d + O \left( \frac xy \right).
  \end{equation}
In light of (\ref{eq:E}), in order to show that
\begin{equation} \label{eq:ee}
E(x|y)=o(x) \qquad \mbox{ as } x\to \infty,
\end{equation}
we only need to show that
\begin{equation} \label{eq:E1}
T_0:=\sum_{d|\Pi_y} \frac{\delta(x/d)}d = o(1) \quad \mbox{ as } x\to \infty.
\end{equation}
We split the above sum in two parts as follows:
\begin{eqnarray} \label{eq:T0} \nonumber
T_0 & = & \sum_{d|\Pi_y \atop d\le x/\log x} \frac{\delta(x/d)}d  + \sum_{d|\Pi_y \atop x/\log x < d \le x} \frac{\delta(x/d)}d  \\ \nonumber
& \le & \delta(\log x) \sum_{d|\Pi_y \atop d\le x/\log x} \frac 1d  + c\sum_{d|\Pi_y \atop x/\log x < d \le x} \frac 1d  \\
& = & \delta(\log x) T_1 + c T_2,
\end{eqnarray}
where $c$ is some positive constant. On the one hand, we have
\begin{equation} \label{eq:T1}
T_1 \le \prod_{x^\varepsilon\le p \le x} \left( 1 + \frac 1p \right) \ll \exp\left\{ \sum_{x^\varepsilon\le p \le x} \frac 1p \right\} \ll \frac 1{\varepsilon}.
\end{equation}
On the other hand,
setting $U_0=x/\log x$ and letting $j_0$ be the smallest positive integer satisfying $2^{j_0+1}U_0>x$, we have
\begin{eqnarray} \label{eq:T2} \nonumber
T_2 & \le & \sum_{j=0}^{j_0} \frac 1{2^j U_0} \sum_{2^j U_0 \le d< 2^{j+1} U_0 \atop p(d)>x^\varepsilon} 1 \\
& \le & \sum_{j=1}^{j_0} \prod_{p<x^\varepsilon} \left(1 - \frac 1p \right) \ll \frac{j_0}{\log x}  \ll \frac{\log \log x}{\log x}.
\end{eqnarray}
Combining (\ref{eq:T1}) and (\ref{eq:T2}), we immediately obtain  (\ref{eq:E1}), from which (\ref{eq:ee}) follows.

\vskip 10pt



On the other hand,
\begin{equation} \label{eq:psi}
 \Psi(x,y) \ge_\varepsilon x \qquad \mbox{for } x^\varepsilon \le y \le x.
 \end{equation}
Combining (\ref{eq:ee}) and (\ref{eq:psi}), we get that
\begin{equation} \label{eq:**}
\lim_{x\to \infty} \max_{x^\varepsilon \le y \le x} \frac{|E(x|y)|}{\Psi(x,y)}=0 .
\end{equation}
Given a positive integer $k$ and a positive integer $n$, it will be convenient to write
$$Q_k(n) = Q_k = P_k(n) P_{k-1}(n) \cdots P_1(n).$$

Then, write
\begin{equation} \label{eq:s1s2}
S_f(x) = \sum_{n\le x \atop P_k(n) \le x^\varepsilon} f(n) e(\alpha P_k(n)) +
\sum_{n\le x \atop P_k(n) > x^\varepsilon} f(n) e(\alpha P_k(n)) = S_f'(x) + S_f''(x),
\end{equation}
say.

First, observe that it is an easy consequence of the Tur\'an-Kubilius inequality that
$$\sum_{n\le x} \left( \sum_{p|n \atop x^\varepsilon < p \le x} 1 - \sum_{x^\varepsilon < p \le x} \frac 1p \right)^2
\ll  x \sum_{x^\varepsilon < p \le x} \frac 1p \ll  x \log(1/\varepsilon),$$
from which it follows that
$$ \sum_{n\le x \atop P_k(n) \le x^\varepsilon} \left( k- \log(1/\varepsilon)\right)^2 \ll x \log(1/\varepsilon).$$
Using this, we conclude that
\begin{equation} \label{eq:s1}
\left| S_f'(x) \right| \le \#\{n\le x: P_k(n)\le x^\varepsilon\} \ll \frac x{\log(1/\varepsilon)}.
\end{equation}
Similarly, we can say that
$$\#\{n\le x: P_{k+1}(n)\le x^\varepsilon\} \ll \frac x{\log(1/\varepsilon)}.$$
This implies that $Q_k(n)\le x^{1-\varepsilon}$ for all but $\displaystyle{O\left( \frac x{\log(1/\varepsilon)} \right) }$ integers $n\le x$.

This means that
\begin{equation} \label{eq:s2}
\left| S_f''(x) \right| \le \left| e(\alpha P_k) f(Q_k) E(x/Q_k|P_k)    \right| + O\left( \frac x{\log(1/\varepsilon)} \right).
\end{equation}
Using (\ref{eq:**}), we obtain that the summation on the right-hand side of (\ref{eq:s2}) is
$$o\left( x \sum_{p_k\cdots p_1\le x \atop x^\varepsilon < p_k<\cdots <p_1} \frac 1{p_k\cdots p_1}\right)
 =o\left(x \frac 1{k!} \left(  \sum_{x^\varepsilon < p \le x} \frac 1p \right)^k\right) = o\left(x \left( \log \frac 1{\varepsilon} \right)^k\right) ,$$
implying that
\begin{equation} \label{eq:s2a}
S_f''(x) =o(x) \qquad \mbox{as } x \to \infty.
\end{equation}
Substituting (\ref{eq:s1}) and (\ref{eq:s2a}) in (\ref{eq:s1s2}),
we obtain (\ref{eq:*}).

It remains to consider case (a) of Hal\'asz's theorem (Lemma \ref{lem:1}), that is when
there exists a real number $\tau_0$ for which the series
$$ \sum_p \frac{1-\Re(f(p)/p^{i\tau_0})}p  $$
is convergent. In light of Lemma \ref{lem:2} we can assume that $\tau_0=0$, that is that
\begin{equation} \label{eq:sum0}
\sum_p \frac{1-\Re(f(p))}p < \infty.
\end{equation}
For each prime power $p^a$, let us write $f(p^a)=\exp\{ i u(p^a) \}$ where $u(p^a)\in [-\frac{\pi}2, \pi)$. It follows that
$$ \sum_p \frac{u^2(p)}p < \infty.$$

Now let $D$ be a large number and define the multiplicative functions $f_D$ and $g_D$ on prime powers $p^a$ by
$$f_D(p^a) = \begin{cases} f(p^a), & \text{ if } p\le D; \\
1, & \text{ if } p>D; \end{cases}  \qquad  \text{and} \qquad
g_D(p^a) = \begin{cases}
1, & \text{ if } p\le D;\\
f(p^a), & \text{ if } p>D. \end{cases}
$$
Then define the arithmetical function $t(n)$ implicitly by the relation
$f_D(n)=\sum_{\delta|n} t(\delta)$. Since one easily sees that $t(p)=0$
if $p>D$, it follows that the above summation runs over only those
divisors $\delta$ for which $P(\delta)\le D$.

Further define
$$a_D(x):= \sum_{D<p \le x} \frac{u(p)}p.$$
Using the Tur\'an-Kubilius inequality, we  obtain that
$$\sum_{n\le x} \left( \sum_{p^a\|n \atop p>D} u(p^a) -a_D(x)  \right)^2 \ll x \sum_{p>D} \frac{u^2(p^a)}{p^a} \ll x
\eta_D^2,$$
say, where $\eta_D\to 0$ as $D\to \infty$.

It follows from this that
$$\sum_{n\le x} \left|  f(n) -f_D(n) e^{ia_D(x)} \right|^2 \ll \eta_D^2 x,$$
and therefore that
$$\sum_{n\le x} \left|  f(n) -f_D(n) e^{ia_D(x)} \right| \ll \eta_D x.$$
We may conclude from this that
$$S_f(x) = e^{-i a_D(x)} A_D(x) + O(\eta_D x),$$
where
$$A_D(x) := \sum_{n \le x} f_D(n) e(\alpha P_k(n)).$$
For each integer $\delta\ge 1$, let
$$B_\delta(y)=\sum_{m\le y} e(\alpha P_k(\delta m)).$$
With this definition, we may write
\begin{equation} \label{eq:*0}
A_D(x) = \sum_{\delta\le x \atop P(\delta) \le D} t(\delta) B_\delta \left( \frac x{\delta} \right).
\end{equation}

Now if $P_k(\delta m) \neq P_k(m)$, then either $\omega(m)\le k-1$ or $P_k(m)\le D$. Thus
\begin{equation} \label{eq:exclam}
\left|  B_\delta\left(\frac x{\delta} \right) - B_1 \left( \frac x{\delta} \right) \right| \le
\sum_{m\le x/\delta \atop \omega(m)\le k-1} 1 + \sum_{Q\nu \le x/\delta  \atop \omega(Q)\le k-1,\ P(\nu)\le D} 1
= U_1(x) + U_2(x),
\end{equation}
say. Write
\begin{equation} \label{eq:u0}
U_1(x) = \sum_{\delta \le \sqrt x} * + \sum_{\sqrt x < \delta \le x} * = U_1'(x) + U_1''(x),
\end{equation}
say. Then, it is clear that
\begin{equation} \label{eq:u1}
U_1''(x) \le \sum_{m\le \sqrt x} 1 \le \sqrt x.
\end{equation}
On the other hand, using the Hardy-Ramanujan inequality 
(see, for instance, \cite[Theorem 10.1]{kn:book}), it follows that there exist two absolute positive constants $c_1$ and $c_2$ such that
\begin{equation} \label{eq:u2}
U_1'(x) \le \frac{c_1x}{\delta\log x} \frac{(\log \log x+c_2)^{k-2}}{(k-2)!}.
\end{equation}
On the other hand,
\begin{equation} \label{eq:v0}
U_2(x) \le  U_2'(x) +U_2''(x),
\end{equation}
where in $U_2'(x)$, we sum over those $Q\le \sqrt{x/\delta}$, while in $U_2''(x)$, we sum over those $\nu \le \sqrt{x/\delta}$. To estimate $U_2'(x)$, we proceed as follows.
First, using Lemma \ref{lem:2a} (b), we get
\begin{equation} \label{eq:v1}
U_2'(x) \le \sum_{Q\le \sqrt{x/\delta} \atop \omega(Q)\le k-1} \sum_{\nu \le x/\delta Q \atop P(\nu)\le D} 1
\ll  \sum_{Q\le \sqrt{x/\delta} \atop \omega(Q)\le k-1}  \frac x{\delta Q} \exp\left\{ - \frac 12 \frac{\log(x/\delta Q)}{\log D} \right\}.
\end{equation}
Since $\displaystyle{ \frac x{\delta Q} \ge \left( \frac x{\delta} \right)^{1/4} \ge x^{1/8}  }$, it follows from (\ref{eq:v1}) that
\begin{equation} \label{eq:v1a}
U_2'(x) \ll \sum_{Q\le \sqrt{x/\delta} \atop \omega(Q)\le k-1}
 \frac x{\delta Q} \exp\left\{ - \frac 1{16} \frac{\log x}{\log D} \right\}.
\end{equation}
Since
$$ \sum_{Q\le x \atop \omega(Q)\le k-1} \frac 1Q \ll (\log \log x)^{k-1},$$
it follows from (\ref{eq:v1a}) that, given any positive number $K$,
\begin{equation} \label{eq:v1b}
U_2'(x) \ll_D \frac x{\delta} (\log x)^{-K}.
\end{equation}
On the other hand, setting $\pi_k(x):=\#\{n\le x: \omega(n)=k \}$ and again using the 
Hardy-Ramanujan inequality, it follows that 
\bigbreak
\begin{eqnarray} \label{eq:v2} \nonumber
U_2''(x) & \le & \sum_{\nu \le \sqrt{x/\delta} \atop P(\nu)\le D} \sum_{Q\le x/\delta \nu \atop \omega(Q)\le k-1} 1 \\  \nonumber
&\le & (k-1) \sum_{\nu \le \sqrt{x/\delta} \atop P(\nu)\le D} \pi_{k-1} \left( \frac x{\delta \nu} \right) \\  \nonumber
& \le & c_1 \sum_{P(\nu) \le D} \frac{kx}{\delta \nu} \cdot \frac 1{\log x}
\frac{(\log \log x+c_2)^{k-2}}{(k-2)!}\\  \nonumber
& \le & \frac{c_1x}{\delta \log x} (\log \log x+ c_2)^{k-2} \prod_{p\le D} \left( 1- \frac 1p \right)^{-1} \\
& \ll &  \frac{x}{\delta} \frac{\log D}{\log x} (\log \log x)^{k-2}.
\end{eqnarray}
Substituting (\ref{eq:u1}) and (\ref{eq:u2}) in (\ref{eq:u0}), and then using (\ref{eq:v1b}) and (\ref{eq:v2}) in (\ref{eq:v0}), we obtain from (\ref{eq:exclam}) that
$$\max_{\delta \le \sqrt x} \frac 1{x/\delta} \left| B_\delta \left( \frac x{\delta} \right) -
B_1 \left( \frac x{\delta} \right) \right| \ll \frac 1{\sqrt{\log x}},$$
say. It follows from this last estimate and (\ref{eq:*0}) that for some positive constant $c_3$
 \begin{eqnarray} \label{eq:AD} \nonumber
 \left| A_D(x) \right| & \le & x \sum_{\sqrt x < \delta < x \atop P(\delta) \le D} \frac{|t(\delta)|}{\delta} +
 \sum_{\delta \le \sqrt x \atop P(\delta) \le D} |t(\delta)| \left| B_1 \left( \frac x{\delta} \right)  \right| +
 \frac {c_3}{\sqrt{\log x}} \sum_{\delta \le \sqrt x} |t(\delta)| \frac x{\delta} \\
 & = & x W_1(x) + W_2(x) + \frac{c_3x}{\sqrt{\log x}} W_3(x),
 \end{eqnarray}
 say.

 Since
 $$W_3(x) \le \prod_{p\le D} \left( 1 + \frac{|t(p)|}p + \frac{|t(p^2)|}{p^2} + \cdots \right)$$
 and since $|t(p^a)| = |f(p^a)-f(p^{a-1})|\le 2$, it follows that
 \begin{equation} \label{eq:sc}
 W_3(x) \le c( \log D)^2.
 \end{equation}
 Using Lemma \ref{lem:3}, we obtain that, as $x\to \infty$,
 \begin{equation} \label{eq:sb}
 W_2(x) = o\left( x W_3(x) \right) = o\left( x (\log D)^2 \right).
 \end{equation}
 In order to estimate $W_1(x)$, let us first find an upper bound for
 $$\kappa(v):= \sum_{v\le \delta \le 2v \atop P(\delta)\le D} t(\delta) \qquad \mbox{ for } \sqrt x \le v \le x.$$
 We have
 \begin{equation} \label{eq:ku}
 \kappa(v)  \le  2 \sum_{k\le \sqrt{2v} \atop P(k) \le D} \sum_{\ell \in [v/k,2v/k] \atop P(\ell)\le D} 1
  \le  2 \sum_{k\le \sqrt{2v} \atop P(k) \le D}  \Psi\left( \frac{2v}k, D \right).
 \end{equation}
 Since $\displaystyle{ \frac{2v}k \ge \sqrt{2v} \ge \sqrt x}$, it follows that, given any arbitrary large number $R>0$,
 \begin{equation} \label{eq:this}
 \Psi \left( \frac{2v}k , D \right) \le \frac{2vc}k (\log x)^{-R}.
 \end{equation}
 Let $v_0=\sqrt x$ and, for each integer $j\ge 1$, let $v_j=2^j \sqrt x$. Letting $j_0$ be the smallest positive integer such that $v_{j_0}\ge x$, so that $j_0=O(\log x)$, we obtain, using (\ref{eq:this}) in (\ref{eq:ku}),  that
 \begin{equation} \label{eq:sa}
 W_1(x) \le \sum_{j=0}^{j_0} \frac{\kappa(v_j)}{v_j} \ll \frac{j_0+1}{(\log x)^R}.
 \end{equation}
 Substituting (\ref{eq:sc}), (\ref{eq:sb}) and (\ref{eq:sa}) in (\ref{eq:AD}), we obtain that
 $$A_D(x) = o(x) \qquad \mbox{as } x\to \infty,$$
 thus completing the proof of Theorem~\ref{main}.

\section{Acknowledgments}

Research of the first author was supported by a grant from NSERC and that of the second author by ELTE IK.

\begin{thebibliography}{9}

\bibitem{kn:banks} W. D. Banks, G. Harman and I. E. Shparlinski,
Distributional properties of the largest prime factor, {\it Michigan
Math. J.} {\bf 53} (2005), 665--681.


\bibitem{kn:largest} J. M. De Koninck and I. K\'atai,
Exponential sums involving the largest prime factor function, {\it Acta
Arith.} {\bf 146} (2011), 233--245.

\bibitem{kn:book}
J. M. De Koninck and F. Luca, {\it Analytic Number Theory: Exploring
the Anatomy of Integers},
Graduate Studies in Mathematics, Vol.\ 134, American Mathematical Society,
2012.

\bibitem{kn:hal} G. Hal\'asz, \"Uber die Mittelwerte multiplikativen
zahlentheoretischer Funktionen, {\it Acta Math. Acad.  Scient.
Hungaricae} {\bf 19} (1968), 365--404.

\bibitem{kn:kui} L. Kuipers and H. Niederreiter, {\it Uniform
Distribution of Sequences}, John Wiley \& Sons, 1974.

\bibitem{kn:spilker} W. Schwarz and J. Spilker, {\it Arithmetical
Functions}, London Mathematical Society Lecture Note Series, Vol.\ 184,
Cambridge University Press, 1994.

\bibitem{kn:vin} I. M. Vinogradov, {\it The Method of Trigonometrical
Sums in the Theory of Numbers}, translated from the Russian, revised
and annotated by K. F. Roth and Anne Davenport. Reprint of the 1954
translation. Dover Publications, 2004.


\end{thebibliography}



\bigskip
\hrule
\bigskip

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

\noindent \emph{Keywords: }
exponential sum, largest prime factor.

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received  October 7 2012;
revised version received  October 27 2012. 
Published in {\it Journal of Integer Sequences}, March 2 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}


.
