Difference between sum of first n primes and prime(prime(n))

75 Views Asked by At

The seq is:

-1, 0, -1, 0, -3, 0, -1, 10, 17, 20, 33, 40, 59, 90, 117, 140, 163, 218, 237, ... http://oeis.org/A239731

Is there's a formula looks like $$a(n) =n^2logn/2$$ for this seq?

1

There are 1 best solutions below

0
On

The sum of the first $n$ primes is asymptotic to $\frac{n^2\log n}{2}$. Heuristically, this is because we are summing integers roughly up to $n\log n$, the size of the $n$th prime, but only $1$ of every $\log n$ integers actually is prime $\implies \frac{n^2\log n}{2}$. This argument can be made precise with partial summation.

With the same heuristic in mind, the $n$th prime is roughly $n\log n$, so that the $n \log n$th prime is roughly $(n\log n) \log(n \log n) \ll n^2\log n$.

So one would think that your guessed asymptotic is the correct asymptotic. I suspect that this can also be made more formal and precise (though I'm going to sleep).