## Tuesday, April 15, 2014

### Estimation of Frequency of Prime Numbers.

As is well known, the simplest estimate of the frequency of prime numbers (up to a given number n) is given by the formula, n/log n (using the natural logarithm based on e). For our purposes we will refer to as version (1) of the log formula.

However though the accuracy of this formula improves in relative terms as n increases, ultimately approaching 100% accuracy, it is not really very accurate in absolute terms. In the following table, I give the actual occurrence of primes to various powers of 10 (to 1016). I also give the predicted number using the simple log formula and then its percentage accuracy.

 Up to n No. of  primes Estimated no. % accuracy (1) % accuracy (2) 10 4 4 100 57.14 100 25 22 88 88.61 1000 168 145 86.31 96.55 10000 1229 1086 88.36 99.03 100000 9592 8686 90.55 99.46 1000000 78498 72382 92.21 99.55 10000000 664579 620421 93.36 99.65 100000000 5761455 5428681 94.22 99.70 1000000000 50847534 48254942 94.90 99.74 10000000000 455052511 434294482 95.44 99.76

As we can see, though the absolute deviation from the true number of primes significantly increases, the relative percentage of estimated primes (in terms of the actual number) steadily increases so that by 1010, it is over 95% accurate.

However a significant improvement can be achieved in a recursive manner by defining

n1 = n/log n and then obtaining the new modified estimate,
i.e. n/log n + n1/log n as in (2) above.

As can be seen from the above the new modified version of the formula quickly becomes a much more accurate predictor of the percentage of primes (over this range). For example, already at 10,000 it has reached 99% accuracy (as opposed to 88% using the traditional method).

One other interesting feature is that whereas the traditional method always under-predicts (over the ranges yet capable of estimation), the modified version always over-predicts.

The largest estimate for actual primes that I dealt with was for 1016 , which is
10,000,000,000,000,000. The actual number of primes to this number is 279,238,341,033,925.

Now the simplest log estimate (1) predicts 271,434,051,189,532 primes (an underestimate) which is 97.21% accurate.

The modified log estimate (2) then predicts 279,601,229,526,797 primes (an overestimate) which is 99.87% accurate.

Now these estimates will still remain quite poor when compared to the Gaussian Li estimate and also Riemann's function.

However its still remains of great interest in pointing to what appears to be strong evidence for the recursive nature of overall prime behaviour.

It is not readily apparent how Littlewood's proof that the Gaussian Li conjecture (i.e. that it would always lead to an underestimate of the primes) was in error, would apply to the much less accurate crude log estimate which in version (1) substantially underestimates the number of  actual primes.