If $\sum\_{p\mid n} 1=\omega(n)$, with $1\leq t\leq q-1$ an integer, and $q$ an arbitrary prime.


Then what known asymptotics or bounds can be obtained for $\sum\_{n\leq x}e^{2\pi i t\omega(n)/q}$


More specifically I am looking for an estimate on,


$$\sum\_{p\leq x}\frac{1}{p}\sum\_{n\leq x}\sum\_{t=1}^{p-1}e^{2\pi i t \omega(n)/p}$$


I am aware that for a fixed constant $c$ that , $e^{c\omega(n)}$ is multiplicative if that helps at all, so that


$$\sum\_{n=1}^\infty\frac{e^{2\pi i t\omega(n)/q}}{n^s}=\prod\_{p}(1+\frac{e^{2\pi i t/q}}{p^s-1})$$



Help estimating an exponential sum
The sum $\sum\_{n\le x} e^{2\pi i t \omega(n)/q}$ is the sum 
of a multiplicative function whose value at a prime $p$ is 
$e^{2\pi i t/q}$. Asymptotics for partial sums of multiplicative 
functions $f$ with $f(p)=z$, a given number, are well understood 
by work of Selberg and Delange. The answer is 
$$ 
\sim C x (\log x)^{z-1}/\Gamma(z), 
$$ 
where $C = C(f)$ is the 
limiting value of $(\sum\_{n=1}^{\infty} f(n)/n^s) \zeta(s)^{-z}$ as $s\to 1$, and 
$\Gamma(z)$ is the usual $\Gamma$ function. 


See Selberg's paper Note on a paper of L.G. Sathe; or Tenenbaum's book on 
analytic and probabilistic number theory for more on this topic. 


One can also understand the sum of $\omega(\omega(n))$ for $n\le x$ more directly. 
Almost all numbers up to $x$ have about $\log \log x$ prime factors (up to deviations of 
about $\sqrt{\log \log x}$), and then a number of size $\log \log x$ would have 
about $\log \log \log \log x$ prime factors. So I would guess this answer to be 
about $x \log \log \log \log x$. 


