# Average succesive distances between primes below n, graphed

• Jun 9th 2010, 10:00 AM
mfetch22
Average succesive distances between primes below n, graphed
I wrote a computer program function that takes an integer as input and outputs the average distance between all the succesive primes below this integer. I graphed the data and ran a logarithmic regression on it and came up with the green curve seen in the attached image. Would this regularity be something expected of a graph like this? Its just an interesting property, to me.
• Jun 9th 2010, 10:50 AM
chiph588@
Quote:

Originally Posted by mfetch22
I wrote a computer program function that takes an integer as input and outputs the average distance between all the succesive primes below this integer. I graphed the data and ran a logarithmic regression on it and came up with the green curve seen in the attached image. Would this regularity be something expected of a graph like this? Its just an interesting property, to me.

The prime number theorem tells us $\pi(x)\sim\frac{x}{\log x}$.

This can be manipulated to show $p_n\sim n\log n$, where $p_n$ is the $n^{th}$ prime.

So loosely speaking, $S(n)=\frac{1}{\pi(n)}\sum_{i=2}^{\pi(n)} (p_i-p_{i-1})=\frac{p_{\pi(n)}-2}{\pi(n)}$ $\sim \frac{\pi(n)\log \pi(n)}{\pi(n)}=\log \pi(n) \sim \log n-\log\log n \sim \log n$ since the sum is telescoping.