I was playing around with prime numbers and I noticed that for $n$ an even number, the average of the distance between all primes between $n/2$ and $n$ and $n/2$ is equal to $\lfloor {\frac {n}{4}} \rfloor $, in an equation: $$\lfloor {\frac {n}{4}} \rfloor= \frac{1}{\pi (n)-\pi (n/2)} \sum_{n/2<p<n} p-\frac {n}{2}$$ I do not know any programming and so to check I must perform all operations by hand, still, I have been able to verify this for all numbers less than 100. I am, however, completely oblivious to the reason behind this or even if this pattern holds for all numbers beyond 100. I have tried to explain it through Bertrand's Postulate but so far I am stuck at square one.
My questions are: Does this pattern hold for all numbers? If it does, why?

  • 1
    $\begingroup$ For $n=6$ the LHS is $1$ and the RHS is $2$. $\endgroup$ – Erick Wong Jul 13 '15 at 19:30
  • $\begingroup$ @ErickWong hmmm, I must have made a mistake in the calculation. Are there any other counterexamples or is this a case of the "small numbers don't always work" phenomenon? $\endgroup$ – Guacho Perez Jul 13 '15 at 19:35
  • 1
    $\begingroup$ @GuachoPerez Can you show some examples for bigger numbers? It looks like to me that RHS is not integer for many cases. $\endgroup$ – Abel Cheung Jul 13 '15 at 19:37
  • $\begingroup$ 20: primes between 10 and 20 {11,13,17,19}, (11-10)+(13-10)+(17-10)+(19-10)=20, $20/4=5=\lfloor 20/4 \rfloor$ $\endgroup$ – Guacho Perez Jul 13 '15 at 19:57
  • $\begingroup$ @GuachoPerez I suspect this is a case of the "only a handful of small numbers work" phenomenon. It's really difficult to believe there exists any exact non-trivial linear relation between $\pi(n)$ and the summatory function of primes. As Abel notes, why should the RHS even be an integer when $n$ is large? $\endgroup$ – Erick Wong Jul 13 '15 at 20:10

I think this is a compelling argument that nothing of the sort is true for most $n$: let $n$ be chosen such that neither $n+1$ nor $n/2+1$ is prime (by PNT, this holds for most $n$, and more explicitly one can take $n = 12k+2$).

Now consider going from $n \mapsto n+2$. The set of primes in the summation on the RHS does not change at all (since $(n+2)/2$ isn't prime, no primes are lost at the low end, and $n+1$ isn't prime so no primes are introduced at the high end). But the average value decreases by exactly $1$ (since $n/2$ increases). Furthermore, the LHS increases by either $0$ or $1$. So the equality cannot possibly hold for both $n$ and $n+2$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.