Asymptotic Formula for a Mertens Style Sum Hello,
I am wondering if there is a simple asymptotic formula for
$$\sum_{p\leq x}\frac{\left(\log p\right)^{k}}{p},$$
where $k\geq0$ is some integer. If $k$ is $0,$ by using the Prime Number Theorem we have 
$$\sum_{p\leq x}\frac{1}{p}=\log \log x+b+O\left(e^{-c\sqrt{\log x}}\right).$$
Similarly, the prime number theorem and integration by parts solves the case $k=1$ and gives 
$$\sum_{p\leq x}\frac{\left(\log p\right)}{p}=\log x+C+O\left(e^{-c\sqrt{\log x}}\right).$$ 
My question is do these integrals have a nice asymptotic formula for every $k$? Specifically, I mean with an error term of the form $O\left(e^{-c\sqrt{\log x}}\right).$
Thanks!
Remark:  This question is related, and in particular if it is solved with a nice enough asymptotic, then so is this.  (but not vice versa)
 A: Expanding on Frank's answer: by partial summation, we have that
$$\sum_{p \leq x} \frac{(\log p)^k}{p} = \frac{(\log x)^k}{x} \pi(x) - \int_{2}^{x} \pi(t) \left(\frac{kt (\log t)^{k-1} - (\log t)^k}{t^2}\right) dt.$$
Using the fact that $\pi(x) = \mathrm{Li}(x) + E(x)$, where $E(x) = O(e^{-c\sqrt{\log x}})$, we have that the first term is equal to
$$\frac{(\log x)^k}{x} \mathrm{Li}(x) + O((\log x)^k e^{-c\sqrt{\log x}}) = \frac{(\log x)^k}{x} \mathrm{Li}(x) + O(e^{-c_k \sqrt{\log x}}).$$
For the second term,
$$- \int_{2}^{x} \pi(t) \left(\frac{kt (\log t)^{k-1} - (\log t)^k}{t^2}\right) dt = R_1(x) + R_2 + R_3(x),$$
where
$$R_1(x) = - \int_{2}^{x} \mathrm{Li}(t) \left(\frac{kt (\log t)^{k-1} - (\log t)^k}{t^2}\right) dt,$$
$$R_2 = - \int_{2}^{\infty} E(t) \left(\frac{kt (\log t)^{k-1} - (\log t)^k}{t^2}\right) dt,$$
$$R_3(x) = \int_{x}^{\infty} E(t) \left(\frac{kt (\log t)^{k-1} - (\log t)^k}{t^2}\right) dt.$$
Let's look at $R_1(x)$ first. Using the fact that $\mathrm{Li}(t) = \int_{2}^{s} \frac{ds}{\log s}$ and interchanging the order of integration, then evaluating the integral with respect to $t$, we obtain
$$R_1(x) = - \frac{(\log x)^k}{x} \mathrm{Li}(x) + \frac{(\log x)^k}{k} - \frac{(\log 2)^k}{k}.$$
For $R_3(x)$, a simple calculation shows that
$$R_3(x) \ll - \int_{x}^{\infty}{(\log t)^{k-1} e^{-c\sqrt{\log t}} \left(\frac{kt - \log t}{t^2}\right) dt} = - \int_{\log x}^{\infty}{u^{k-1} e^{-c\sqrt{u}} \left(\frac{ke^{u} - u}{e^u}\right) du}.$$
We can rewrite this integral as
$$- \int_{\log x}^{\infty}{\left(ku^{k-1} e^{-c\sqrt{u}} - \frac{c}{2} u^{k - 1/2} e^{-c\sqrt{u}}\right) + \left(\frac{c}{2} u^{k - 1/2} e^{-c\sqrt{u}} - u^k e^{-c\sqrt{u} - u}\right) du}$$
and from this it is clear that
$$R_3(x) \ll_k - \int_{\log x}^{\infty}{\left(ku^{k-1} e^{-c\sqrt{u}} - \frac{c}{2} u^{k - 1/2} e^{-c\sqrt{u}}\right) du} = (\log x)^k e^{-c \sqrt{\log x}} \ll e^{-c_k \sqrt{\log x}}.$$
Finally, it's clear from the estimate for $R_3(x)$ that the integral defining $R_2$ converges, and so we obtain
$$\sum_{p \leq x} \frac{(\log p)^k}{p} = \frac{(\log x)^k}{k} - \frac{(\log 2)^k}{k} + R_2 + O_k(e^{-c\sqrt{\log x}}).$$
Note that it's possible to make this valid for much more than just nonnegative integers $k$ - you could also have $k$ complex.
A: Here is an answer that is similar in spirit to Frank and Peter's answers, but possibly simpler.
Summing by parts, we see that
$$ \sum_{p\le x} \frac{\log^k p}{p} = (\log x)^{k-1} \sum_{p\leq x} \frac{\log p}{p} -(k-1)\int_{2^-}^x (\log u)^{k-2}\sum_{p\le u} \frac{\log p}{p} \frac{du}{u}.$$
Now use the formula
$$ \sum_{p\leq x} \frac{\log p}{p} = \log x + c_1 + O(\exp(-c_2\sqrt{\log x}))$$
and it is not hard to derive that
$$ \sum_{p\le x} \frac{\log^k p}{p} = \frac{\log^k x}{k} + c_3 + O(\exp(-c_4\sqrt{\log x})).$$
This seems easier than dealing with $Li(x)$.
A: Sure. You can write the expression as a Stieltjes integral
$$\int_2^x \frac{(\log t)^k}{t} d\pi(t).$$
Integrate by parts to get
$$\frac{(\log t)^k}{t} \pi(t) - \int_2^t \pi(t) \frac{d}{dt} \Big( \frac{(\log t)^k}{t} \Big).$$
Now apply the prime number theorem and replace $\pi(t)$ by $\frac{t}{\log t} + E(t)$ where the error bound $E(t)$ (assumed increasing in $t$) is given by the expression you gave above. You now have an asymptotic formula of the type you were looking for, involving an elementary integral which you could clean up further if you like. The total error is $\ll (\log t)^k E(t).$
