Let $p_i$ denote the $i$th prime number, and let $p_k\#$ denote the $k$th primorial, $p_k\# \overset{\textrm{def}}= \prod_{i \le k} p_i$.
I am interested in asymptotic upper bounds for the function $S(N) = \sum_{i =1}^{k(N)} p_i$, where $k(N)$ is the smallest $k$ such that $N \le p_k\#$.
As a concrete example, if $N=2^{128}$ then $k(N) = 27$ since the 27th primorial is $2 \cdot 3 \cdots 103 > 2^{128}$. Hence $S(N)$ is the sum of the first 27 primes, which is 1264.
I can come up with what seems to be a very unsophisticated bound, as follows:
- $k(N) = O(\log N)$ trivially
- the $k$th prime has magnitude $O(k \log k)$
- Hence $S(N) = O( k^2 \log k) = O( \log^2 N \log\log N)$
Again, this seems very superficial, and I'm wondering if it's possible to obtain a tighter bound, perhaps $O(\log N \log\log N)$.
edit: After finding this related question, the bound can be improved to $k(N) = O(\log N / \log\log N)$, resulting in $S(N) = O(\log^2 N / \log\log N)$. Is it possible to do better?
Also seems related to A008472 but no asymptotic expressions are given.