3

Take a function $f(n)$ that takes the differences from $n$ to each prime less than $n$ and sums them all together. For example,

$$f(12) = (12 - 11) + (12 - 7) + (12 - 5) + (12 - 3) + (12 - 2) = 1 + 5 + 7 + 9 + 10 = 32.$$

In mathematical notation,

$$f(n) = \displaystyle\sum_{p}^{n} n - p.$$

Now, create an integer sequence where $n$ is in this sequence if $f(n)$ is prime. This sequence (not in the OEIS to my knowledge) begins $$4, 5, 7, 9, 10, 13, 14, 17, 20, 23, 31, 39, 40, 45, 53, 55, 58, 59, 69, 73...$$ Given an $n > 0$, find the ratio of the number of elements in this sequence less than $n$ to the number of primes less than $n$. What does this ratio approach as $n \to \infty$?

My computer program has calculated it up to $n = 1000000$, reaching a value of $67435/78498\approx 0.85906647303116.$ For $n \in [8000, 1000000]$, the ratio does not stray more than two hundreths away from this value.

Does this ratio approach a nonzero constant? What constant is this?

The only similar constant I know of is $\cos(\pi/6) = \tfrac{\sqrt 3}{2} \approx 0.86602540378...$ but there is no evidence to show that this is what the ratio approaches other than pure chance. Is there any rigorous way to demonstrate what precise value this ratio goes to as $n \to \infty$ (if it doesn't approach $0$ or infinity)? Thanks for your help!

  • 1
    Just to be clear, your function $f(n)=\pi(n)\times n-\sum_{p≤n} p$, right? For large $n$, this should be about $\pi(n)\times \frac n2$, I believe. – lulu Sep 24 '24 at 11:25
  • I can't really follow your sequence. $f(2)=0$, right? There are no primes less than $2$. So why is $2$ in your sequence? Similarly, $f(3)=1$, since the only prime less than $3$ is $2$ and $3-2=1$. So why is $3$ in your sequence? I agree that $f(4)=3$ works. What am I missing? – lulu Sep 24 '24 at 11:41
  • You're right that 2 and 3 are wrong... I may have to check my program. As for $5$, we get $(5-3) + (5-2) = 2 + 3 = 5$, so that should work. – Mathemagician314 Sep 24 '24 at 11:43
  • Yes, $5$ works, I deleted that part of my comment. – lulu Sep 24 '24 at 11:43
  • As to the question, I see no obvious reason why $f(n)$ should be prime or composite, so at a guess I'd assume that it follows the same statistics a general value of the same size would follow. That heuristic should be easy to check in the range you have studied. If it holds experimentally, then I would think that assuming it lets you compute a result. Of course, even if everything works out this would just be a heuristic argument, but at least it would return a value. Of course, if the statistics look odd in one way or another, that might be interesting as well. – lulu Sep 24 '24 at 11:52
  • Because odd numbers always have odd values of $f(n)$, and even numbers sometimes have odd values of $f(n)$, the parity is more often odd than not, which would affect how often it is prime compared to the natural numbers. I wonder if the constant is related to the density of primes... – Mathemagician314 Sep 24 '24 at 12:50
  • The parity issue isn't serious...the probability that a "randomly selected $N$" is prime is $\frac 1{\log N}$, where the probability that a "randomly selected odd number $N$" is prime is $\frac 2{\log N}$. Are there other congruence properties that interfere with that here? – lulu Sep 24 '24 at 12:56
  • $f(n)$ is also $\sum_{m\lt n} \pi(m)$ – Empy2 Sep 24 '24 at 13:45

0 Answers0