7

This morning I got a message on the Active Mathematica yahoo mailing list from the signature "in zero" asking to calculate this sum:

$$\sum _{k=1}^n \frac{\log (p_k)}{\log (p_n)}$$

where $p_n$ is the n-th prime number.

Or as a Mathematica program:

N[Table[Sum[Log[Prime[k]]/Log[Prime[n]], {k, 1, n}], {n, 1, 10}]]

with the output starting:

{1., 1.63093, 2.11328, 2.74787, 3.22992, 4.01955, 4.63896, 5.46372, 6.1308, 6.70876}

Using the prime numbers list from the oeis, http://oeis.org/A000040/a000040.txt I calculated the sum up to the 100 000 - th prime number.

Interested in what the plot looks like I got an approximately linear plot, using the ListLinePlot command:

log sum

But what I find more interesting is the ListPlot of the first differences of the sum:

first differences

What explains the similarly shaped curves in this second plot? Also do these type of curves have a name?

The formula for data in the second plot is: $$\sum _{k=1}^n \frac{\log (p_k)}{\log (p_n)}-\sum _{k=1}^{n-1} \frac{\log (p_k)}{\log (p_{n-1})}$$

Edit 20.4.2013:

For comparison I here add the ListLinePlot of data in the second plot:

ListLinePlot of data in second plot

which does not reveal any pattern.

Mats Granvik
  • 7,396

2 Answers2

5

Recall the primorial function $p_n\#$. According to Wikipedia, it has an asymptotic growth of:

$$p_n\# \sim n^{n(1+o(1))}$$

As a consequence of the Prime Number Theorem, we have $p_n \sim n \log n$.


Now observe that:

$$\sum_{k=1}^n \frac{\log p_k}{\log p_n} = \frac{\log(p_n\#)}{\log p_n}$$

Plugging in these asymptotic values we obtain:

$$\sum_{k=1}^n \frac{\log p_k}{\log p_n} \sim \frac{n(1+o(1)) \log n}{\log n + \log \log n} \sim n(1+o(1))$$

where in the last step it was used that $x \gg \log x$ for $x > 1$.

So indeed, asymptotic behaviour indicates that the growth of your sum is approximately linear.


Edit Was called away unexpectedly; anything I'd have to say on the ListPlot is sufficiently described in achille hui's answer. Together our answers should provide a good overview of what's going on.

Lord_Farin
  • 17,743
5

Let $\Delta_n = \sum_{k=1}^{n} \frac{\log p_k}{\log p_n}$ and $s_n = p_n - p_{n-1}$, we have:

$$\Delta_n - \Delta_{n-1} = 1 + \Delta_{n-1}\left(\frac{\log p_{n-1}}{\log p_n} - 1 \right) = 1 + \Delta_{n-1}\frac{\log (1 - \frac{s_n}{p_n})}{\log p_{n}} \sim 1 - \frac{\Delta_{n-1}}{p_n\log p_n} s_n$$

Based on Lord Farin's answer, we have:

$$\Delta_n \sim n \;\text{ and }\;p_n \log p_n \sim n (\log n)^2 \implies \Delta_n - \Delta_{n-1} \sim 1 - \frac{s_n}{(\log n)^2}$$

The different branches in the ListPlot is nothing special. They just reflect the discreteness/randomness of the gap $s_n$ between successive primes.

achille hui
  • 122,701