Prime Differences average

My method would tell you that the average of the differences between the primes not the primes themselves. It is independent of what the prime values are in the sense that if I tell you that the average after a million primes is, this hypothetical, is between 11.3 and 11.5. I can’t tell you what the millionth prime is.

Now I cant guarantee that the average will always be in the range I predict. I can only tell you that it has worked flawlessly for just below 20 000 primes.

The accuracy level well the lower bound is on average 99% of the actual average and the average of the prime gaps is on average 99% of the upper bound. This can fluctuate. Though I don’t guarantee 99% accuracy forever I do think that the accuracy will remain above 98% for a long time.

As noted, if you know that the average prime gap after a million primes is between 11.3 and 11.5, then you know that the difference between the 1st prime and the millionth prime is (some value between 11.3 and 11.5) times (the number of prime gaps between the 1st prime and the millionth prime), which is to say, between 11.3 * (a million - 1) and 11.5 * (a million - 1). Which means the millionth prime is between the 1st prime + 11.3 * (a million - 1) and the 1st prime + 11.5 * (a million - 1).

Estimating the average prime gap up through the nth prime is quite equivalent to estimating the size of the nth prime. Or, put another way, to estimating the number of primes up to a given bound. Which is an extremely well-studied topic in mathematics!

To push our knowledge of these estimates beyond what is currently known would indeed be considered useful to mathematics, but it is extremely unlikely you have done so if you do not have extensive formal training in mathematics.

That is, your results are not necessarily wrong, but they are very unlikely to be both correct and unknown to the professional mathematical community. But go ahead and share them if you’d like us to evaluate them, rather than being coy.

As above, it’s a well studied problem. Getting tighter bounds (which you don’t really appear to have, if I’m reading correctly, but I could be wrong) would be interesting mathematically but may be of limited interest outside of that.

“Practical” is kind of a loaded word in mathematics, anyway. Many mathematicians don’t really care if there’s any real world application to their work. Others assume there may be some application but aren’t interested in finding them. Others might be interested, but there may already be better methods out there. You’d also really have to do your homework to determine if any result you have is new or a variant on something already known.

One area it might possibly see some real world application is in generating large primes (primarily in encryption). But whenever we need a large prime, there are other ways of generating them. And if we only need a large pseudo-prime (as is often the case), we have plenty of relatively cheap ways of generating them.

If the bounds were sufficiently tight (and in the expected place), it would establish the Riemann Hypothesis, and thus be “practical” in the sense of earning gobs of money. :slight_smile:

I’m not being coy but you are misunderstanding what I am saying I think so for the benefit of everyone I will restate what I have so that it can be evaluated.

Let us say we take the first few primes: 2;3;5;7;11;13;17. Now we know that the gaps between these primes are: 1; 2; 2; 4; 2; 4. The average of these prime gaps is 2,5. Now without knowing these primes and corresponding prime gaps how would you be able to find the region where that average is located? I know of no current method, algorithm or whatever you would like to call it that would narrow an average to a small region. For this example let’s say my lower bound is 2,3 and my upper bound is 2,8. I don’t know the exact values the upper bound may not even be effective at those values but it’s just an example.

I then took the formula for the upper and lower bound and tested it for over 15000 primes. On average the lower bound of the average was 99% of the actual average value. The average was 99% of the upper bound figure. This corresponds to a region of about 0.2 in size.

If there is a formula as or more accurate then I would love to know.

The bounds have an accuracy of over 99% on average and the region for large primes is 0.2. How do you get much smaller than that? But if you want me to I can probably increase the accuracy by a very small margain.

How tight would the bounds have to be?

Indistinguishable misread your e-mail. You are spot on with what I am saying. I didn’t even think about estimating primes. But I can’t promise any level of accuracy for that though. The data is strong it’s 99% accurate and I could get a higher accuracy but it’s not worth the trouble.

Sure, you’re being coy. You haven’t told us what your method for estimating average prime gaps actually is. Tell us, how do you estimate average prime gaps? (You seek to publish this result, right? Well, the whole point of publication is to actually tell people your results!)

All I need to know is the number of primes and the first and last one. The first one will always be 2; in this case, the last one is 17, and there are 7 primes total. From that, I can calculate that the average prime gap will be (17 - 2)/(7 - 1) = 2.5. In general, the average prime gap from 2 up to the n-th prime p will be exactly (p - 2)/(n - 1). So I can estimate the average prime gap of the first n primes if I can estimate what the n-th prime will be, and just as well, I can estimate the average prime gap up through prime p if I can estimate how many primes there are up through p. These are all precisely equivalent problems.

So let me give a simple example of an estimate professional mathematicians have known for more than a century: Let f(n) = ln(n) + ln(ln(n)) - 1 + (ln(ln(n)) - 2)/ln(n). The average prime gap over the first n primes is a little over f(n), but not by much. In fact, the difference becomes and stays arbitrarily small as n gets large.

Is your estimate stronger than this?

I don’t think it is weaker but I will need to check. Would you like the average to be in a percentage or absolute terms?

I will admit I didn’t expect that equation to get that close. After some fiddling and I did modify the original equation. On average my new equation is 0.01133 closer I will expand the data selection and get back to you

You’re still being coy. Unless you tell us what your method for estimating average prime gaps is, there’s no point continuing.

You can guarantee this for arbitrarily large primes? Or just for the ones you have checked so far?

That is a distinction that makes a critical difference. There are plenty of formulas and rules of thumb that break down when generalized.

This is part of the coyness. Without showing any actual work, there’s very little to actually critique or evaluate.

Let me describe known estimates another way:

The average of the first n prime gaps is always larger than ln(n) + ln(ln(n)) - 1, and, once n is in double digits, always smaller than ln(n) + ln(ln(n)).

The difference between those two is 1, and thus we already have guaranteed bounds with an absolute range of 1 [already beating armstrongm’s claim to a range from 99% to 101% of the true value, a range whose absolute size grows arbitrarily large].

But we can do even better than that, in noting that once n is around 30,000 or greater, the average prime gap is always smaller than ln(n) + ln(ln(n)) - 1 + (ln(ln(n)) - 1.8)/ln(n).

Thus, we get guaranteed bounds with absolute range (ln(ln(n)) - 1.8)/ln(n), which gets arbitrarily small as n gets large.

[And we can do even better than that; in the upper bound ln(n) + ln(ln(n)) - 1 + (ln(ln(n)) - 1.8)/ln(n), the 1.8 isn’t magic, but can be replaced by any value below 2 once n gets sufficiently large. (And similarly, a lower bound can be obtained by using values above 2 instead). One just has to do some tedious calculation to determine how large n has to be for these to kick in.]

This seems like it might be tangentilly related, so I’ll ask here:

What is the largest prime for which we also know all the primes smaller than it?

I could see where that might not have a definite answer, so I’ll also ask, what is the largest prime where we know which prime it is? For example, 97 is the 25th prime (probably not the record). That’s a little bit weaker condition.

Of course, the answer will change over time, but currently, the largest n for which it is known how many primes are of n digits or less is 25, for which the answer is 176,846,309,399,143,769,411,680.

I am also very quickly able to compute that 10^25 - 123 is the largest 25 digit prime. Thus, it is the 176,846,309,399,143,769,411,680th prime.

However, just as quickly, I can find that the next several primes are 10^25 +, respectively, each of {13, 223, 343, 349, 451, 513, 559, 561, 583, 607, …}. So you see the difficulty with pinning this down: once you name an example, it’s not hard to top it, and top it again, and again, one by one.

Obviously, however, there is no list of all the primes up to these values (no one has enough space to store it!). I don’t know what the largest complete list of primes up to N is, but, again, once given it, it’s not hard to top it, and top it again, and again, one by one.

But, basically, the best answer is that the order of magnitude for which we know ranks of primes is 10^25, and the order of magnitude for which we know complete list of primes up to is probably wherever space runs out.