# Distribution of prime numbers

#### Vacrin

I don't think i'm the first to observe this, but I thought it would be worth talking about as well as a couple other ideas. First of all, the number of prime numbers as the numbers trends towards infinity, seems to be a changing ratio that approaches 0. granted even at infinity it never reaches 0, but that it does get endlessly close to 0.

starting from about the first 10,000 numbers, the ratio is roughly 1/(8.137 +2.305X), where X is the is 0, at 100,000 it is 1, and 1,000,000 it is 2. the number of prime numbers can be calculated by multiplying the ratio by 10^(X+4). This mostly accurate after 10,000. By accurate i mean that the first 2 digits of the number match with the first 2 digits of the amount of primes within the amount of given numbers.

Pi(x) = number of primes under value x.
Pi(10) = 4 (2,3,5,7)
Pi(100) = 25
Pi(1000) = 1,68
Pi(10000) = 1,229
Pi(100000) = 9,592
Pi(1000000) = 78,498
Pi(10^25) = 176,846,309,399,143,769,411,680

My function = F(x) = 10^(x+4)*(1/(8.137+2.305x))
F(0) = 1,229 first 10,000 numbers
F(1) = 9,577 (100,000)
F(2) = 78,450 (1,000,000)
F(21) = 1,768,596,8.... (10^25)

However the interesting thing is that, as 1/8.137+2.305x trends towards infinity, it = 0.

Thoughts?

#### AplanisTophet

Prime number theorem - Wikipedia, the free encyclopedia

"Let Ï€(x) be the prime-counting function that gives the number of primes less than or equal to x, for any real number x. ... The prime number theorem then states that x / ln(x) is a good approximation to Ï€(x)..."

#### Vacrin

x/ln(x) losses it's accuracy fairly quickly, and then pretty much completely diverges from pi(x) all together. by x/ln(x) at 100,000 it is 8,685. already 1000 off. by 1,000,000 it is 72,382, almost 5k off. Regardless of that though, by the time we are at 10^40, every 1/100 numbers is a prime. by 10^432 every 1/1000 numbers is a prime. And by 10^43,478,258 every 1/10,000,000 numbers is a prime. The rate at which primes space themselves out it slow, but eventually wouldn't it reach infinity as well?

#### CRGreathouse

Forum Staff
x/ln(x) losses it's accuracy fairly quickly, and then pretty much completely diverges from pi(x) all together.
The ratio between the two tends to 1. The difference tends to $x/\log^2x$, I believe. So it's not that bad.

Regardless of that though, by the time we are at 10^40, every 1/100 numbers is a prime. by 10^432 every 1/1000 numbers is a prime. And by 10^43,478,258 every 1/10,000,000 numbers is a prime. The rate at which primes space themselves out it slow, but eventually wouldn't it reach infinity as well?
It increases without bound, if that's what you mean.

#### CRGreathouse

Forum Staff
starting from about the first 10,000 numbers, the ratio is roughly 1/(8.137 +2.305X), where X is the is 0, at 100,000 it is 1, and 1,000,000 it is 2. the number of prime numbers can be calculated by multiplying the ratio by 10^(X+4).
If I understand correctly, you've defined $X=\log_{10}N-4.$ The correct ratio is $1/(\log N-1+o(1))=1/(8.210\ldots+2.302\ldots X+o(1))$ where the constants are log 10 and 4 log 10 - 1. So your formula is a reasonable approximation.

You can do much better with the logarithmic integral, though.

#### Vacrin

Surprisingly no actually, I meant what i said using those simple equations. Although i am surprised that ln(10) = 2.30..... I am curious to see how accurate the equation would be with logs, however i am unable to test it at this present moment.

#### danaj

See this Wikipedia table to see how close the logarithmic integral gets. Adding even one more li term gets closer still. At 10^25 we can get agreement in the first 13 digits.

#### CRGreathouse

Forum Staff
Surprisingly no actually, I meant what i said using those simple equations.
You didn't actually define X, you just gave examples. I wrote a formula for X that matches your examples and then showed what the correct asymptotics are.

#### CRGreathouse

Forum Staff
See this Wikipedia table to see how close the logarithmic integral gets. Adding even one more li term gets closer still. At 10^25 we can get agreement in the first 13 digits.
Is that you, Dana? Welcome!

#### Vacrin

Sorry X was supposed to be just a counting number, because it is part of a function. And the wiki is cool, i used it to come up the formula that i stated at the beginning. The logarithmic one is much more accurate than mine for sure, unfortunately i have no idea how they came up with it :/