# Asymptotics for $g(n) = \sum_{k = 1}^{n - 1} {\frac{{\log (1 + p_k)}}{p_k}}$?

Let $$p_k$$ be the $$k$$th prime.

Now define $$g(n)$$ as

$$g(n) = \sum_{k = 1}^{n - 1} {\frac{{\log (1 + p_k)}}{p_k}}$$

What are the asymptotics for this $$g(n)$$ ?

The related sum

$$\sum_{k = 1}^{n - 1} {\frac{{\log (1 + k)}}{k}}$$ has been well approximated by user gary ( https://math.stackexchange.com/users/83800/gary) in the analogue question

Asymptotics for $f(n) = \prod_{k=2}^{n} \sqrt[k-1]{k}$?

By the Abel–Plana formula \begin{align*} \sum\limits_{k = 1}^{n - 1} {\frac{{\log (1 + k)}}{k}} = \int_1^{n - 1} {\frac{{\log (1 + t)}}{t}{\rm d}t} & - 2\int_0^{ + \infty } {\frac{1}{{{\rm e}^{2\pi y} - 1}}{\mathop{\rm Im}\nolimits}\! \left( {\frac{{\log (2 + {\rm i}y)}}{{1 + {\rm i}y}}} \right){\rm d}y} \\ & + \frac{{\log 2}}{2} + \mathcal{O}\!\left( {\frac{{\log n}}{n}} \right). \end{align*} Here $$- 2\int_0^{ + \infty } {\frac{1}{{{\rm e}^{2\pi y} - 1}}{\mathop{\rm Im}\nolimits} \!\left( {\frac{{\log (2 + {\rm i}y)}}{{1 + {\rm i}y}}} \right){\rm d}y} = \int_0^{ + \infty } {\frac{1}{{{\rm e}^{2\pi y} - 1}}\frac{{y\log (4 + y^2 ) - 2\arctan (y/2)}}{{y^2 + 1}}{\rm d}y}$$ and $$\int_1^{n - 1} {\frac{{\log (1 + t)}}{t}{\rm d}t} = \frac{\log ^2 n}{2} + \frac{{\pi ^2 }}{{12}} + \mathcal{O}\!\left( {\frac{{\log n}}{n}} \right).$$ Accordingly, $$\prod\limits_{k = 2}^n {\sqrt[{k - 1}]{k}} = Cn^{\frac{1}{2}\log n} \left( {1 + \mathcal{O}\!\left( {\frac{{\log n}}{n}} \right)} \right)$$ as $$n\to +\infty$$, where $$\log C = \frac{{\pi ^2 }}{{12}} + \frac{{\log 2}}{2} + \int_0^{ + \infty } {\frac{1}{{{\rm e}^{2\pi y} - 1}}\frac{{y\log (4 + y^2 ) - 2\arctan (y/2)}}{{y^2 + 1}}{\rm d}y} = 1.18493104146 \ldots$$ Addendum. Another way is to note that $$\sum\limits_{k = 1}^{n - 1} {\frac{{\log (1 + k)}}{k}} = \sum\limits_{k = 1}^{n - 1} {\frac{{\log k}}{k}} + \sum\limits_{k = 1}^{n - 1} {\frac{{\log (1 + 1/k)}}{k}} = \frac{{\log ^2 n}}{2} + \gamma _1 + \sum\limits_{k = 1}^\infty {\frac{{\log (1 + 1/k)}}{k}} + o(1)$$ where $$\gamma_1$$ is one of the Stieltjes constants. For the infinite series see this answer of mine or $$\text{A}131688$$ in the OEIS.

That is a nice application of Abel-Plana. Maybe the other formula from Abel is also useful here :

https://en.wikipedia.org/wiki/Abel%27s_summation_formula

Since we are working over the primes.

The goal or main idea was to use this for number theory, ideas such as the generalizations of Collatz or PNT. See the " heuristic estimate " made here :

Collatz variant $7 x + 1$?

And (more in the context of the PNT related ideas ) the idea of some kind of average lenght of prime factorization based on how often we can devide by a prime.

Those heuristic ideas do assume alot of independance and are not formal yet. But that is where the idea is coming from.

A similar function maybe easier to work with is

$$h(n) = \sum_{p_k < n} {\frac{{\log (1 + p_k)}}{p_k}}$$

Where we just consider the sum over the primes smaller than $$n$$.

• the question is like asking for $\sum _{p<X}(\logp)/p$ right, or am i missing something? (and if so i'll just delete this comment) Commented Mar 26, 2023 at 14:42
• @tomos yeah something like that
– mick
Commented Mar 26, 2023 at 15:21
• then you can take a look in (e.g.) Chapter 2 of Montgomery and Vaughan's Multiplicative Number Theory book. essentially: you want to write the $\log$ over primes as von Mangoldt's function, re-write this as a convolution, and evaluate the resulting sum (which is now a sum over natural numbers, not primes). (i can write it explicitly as an answer, or write small further comments here, or maybe that's enough information for you already - as you wish) Commented Mar 26, 2023 at 15:44
• @tomos Ah so you use von Mangoldt' function with the Abel summation formula I guess. Do you also get a closed form constant ? Feel free to write an answer !
– mick
Commented Mar 26, 2023 at 17:34
• sure, i've posted an answer. it's correct to suspect abel summation formula, but because the $\log$ is already in the vM function we're actually ok without it. (to get the sum $\sum _{p<X}1/p$ we'd use abel summation on the sum with the $\log$) Commented Mar 26, 2023 at 19:33

The definition of the von Mangoldt function $$\Lambda$$ is $$\Lambda (n)=\left \{ \begin {array}{ll}\log p&\text { if }n=\text {power of prime p}\\ 0&\text { otherwise.}\end {array}\right .$$ Directly from this definition you get, if $$n=\prod _{p|n}p^N$$, $$\log n=N\sum _{p|n}\log p=\sum _{p^m|n}\log p=\sum _{d|n}\Lambda (d)=\sum _{ab=n}\Lambda (a)$$ so $$\sum _{n\leq X}\log n=\sum _{ab\leq X}\Lambda (a)=\sum _{a\leq X}\Lambda (a)\underbrace {\sum _{b\leq X/a}1}_{=X/a+\mathcal O(1)}=X\sum _{a\leq X}\frac {\Lambda (a)}{a}+\mathcal O\left (X\right ).$$ On the other hand you can compare the LHS sum here to an integral to get $$\sum _{n\leq X}\log n=X\log X+\mathcal O(X)$$ so we've shown $$\sum _{a\leq X}\frac {\Lambda (a)}{a}=\log X+\mathcal O(1).$$ Directly from the definition of $$\Lambda$$ this sum is $$\sum _{p^m\leq X}\frac {\log p}{p^m}=\sum _{p\leq X}\frac {\log p}{p}+\underbrace {\mathcal O\left (\sum _{p^m\leq X\atop {m\geq 2}}\frac {\log p}{p^m}\right )}_{\ll \sum _{n=1}^\infty \frac {\log n}{n^2}\ll 1}$$ so we've shown $$\sum _{p\leq X}\frac {\log p}{p}=\log X+\mathcal O(1).\hspace {10mm}(A)$$ This quantity is almost your sum, we just need to sort the $$p,p+1$$ issue. Since $$\log (p+1)=\log p+\log (1+1/p)=\log p+\mathcal O\left (1/p\right )$$ we get from (A) $$\sum _{p\leq X}\frac {\log (p+1)}{p}=\log X+\mathcal O(1)+\underbrace {\mathcal O\left (\sum _{p\leq X}\frac {1}{p^2}\right )}_{\ll 1}$$ and we're ok.

• Cool thanks. +1 Maybe a bit more detailed for those not so into number theory ? Take that as a compliment. Did you use the PNT somewhere ? Im not sure. (because) this seems to imply the PNT in way , or it is just me ? I had the idea that the PNT is equivalent to $\pi(n) = \frac{n}{\sum _{p\leq n}\frac {\log p}{p}}$ Maybe my comment question here is too vague to answer, sorry.
– mick
Commented Mar 26, 2023 at 19:45
• OMG this is mertens theorem. How could I forget. Feel silly.
– mick
Commented Mar 26, 2023 at 19:48
• sure i'll put some more details Commented Mar 26, 2023 at 21:11
• this is all much weaker than the PNT. it just uses the factorisation $\Lambda =\log \star 1$. chapter 2.1-2.2 of montgomery and vaughan has it all Commented Mar 26, 2023 at 21:25
• regarding "i had the idea that PNT is equivalent to ...". i see where you're coming from, but no for some reason it's easier with the $1/p$ weight. it happens in some sieving problems. probably there are people here who can say much more than me about why this is so Commented Mar 26, 2023 at 21:37

By Mertens' first theorem, \begin{align*} P(x)& :=\sum\limits_{p \le x} {\frac{{\log (1 + p)}}{p}} = \sum\limits_{p \le x} {\frac{{\log p}}{p}} + \sum\limits_{p \le x} {\frac{{\log (1 + 1/p)}}{p}} \\ & = \left[ {\log x + K + \mathcal{O}({\rm e}^{ - c\sqrt {\log x} } )} \right] + \left[ {\sum\limits_p {\frac{{\log (1 + 1/p)}}{p}} + \mathcal{O}\!\left( {\frac{1}{{x\log x}}} \right)} \right] \\ & = \log x + K' + \mathcal{O}({\rm e}^{ - c\sqrt {\log x} } ) \end{align*} with a suitable $$c>0$$, and $$K = - \gamma - \sum\limits_p {\frac{{\log p}}{{p(p - 1)}}} = −1.3325\ldots$$ and $$K' = - \gamma - \sum\limits_p {\frac{{\log p}}{{p(p - 1)}}} + \sum\limits_p {\frac{{\log (1 + 1/p)}}{p}} = - 0.9485 \ldots,$$ where $$\gamma$$ is the Euler–Mascheroni constant. Then using the prime counting function $$\pi$$, $$g(n)=P(\pi(n-1))$$.