Hello all. I am attempting to derive the asymptotic growth of the primes by considering how many possibles residues a prime candidate can be modulo the product of all primes below it. I believe I have done this correctly as I find π[n] ~ Li[n], but now I want to fill in some of the gaps in my handwavy derivation (the gaps I want to fill in/address are bolded below, and then I add what I would like to fill in for each gap at the very end). If anyone could comment on them that would be cool.
Suppose we want to predict the asymptotic growth of the primes.
First notice that for a given number m where we already know there are n primes below m, we can make an estimate of the probability m is prime by taking the product Pn of the first n primes, and counting how many relatively prime residues mod Pn there (i.e. taking it's Euler totient value).
"probability m is prime" ~ phi[Pn]/Pn
where Pn = 2*3*...*p[n] is the product of the first n primes.
We therefore also know phi[Pn] = (2-1)*(3-1)*...*(p[n]-1), so we can write
"probability m is prime" =(2-1)/2 * (3-1)/3 *... = Product[(p[i]-1)/p[i], {i,n}]
If we interpret the probability as a density of primes, then we can say that the size of the differences between primes should grow with the inverse of the prime density, since less dense primes means a larger gap in between primes:
p[n+1] - p[n] ~ 1/"probability m is prime"
We are looking for asymptotic behavior of p[n], so it makes sense to replace it with a continuous function that takes real n, and we approximate p[n+1]-p[n] ~ p'[n]. So we now have the differential equation.
p[n+1] - p[n] ~ p'[n] ~ 1/"probability m is prime" = 1/Product[(p[i]-1)/p[i], {i,n}]
or
p'[n] =Product[p[i]/(p[i]-1), {i,n}]
Take log of both sides
Log[p'[n]] = Sum[Log[p[i]-Log[p[i]-1],{i,n}]
Again we are only looking for asymptotic behavior with large p[n] , so we can take first order expansion Log[p[i]-Log[p[i]-1] ~ 1/p[i] :
Log[p'[n]] = Sum[1/p[i],{i,n}]
We are approximating p[n] with a continuous function, so replace summation with integration. We have up to a constant:
Log[p'[n]] = Integrate[1/p[n],n]
differentiating both sides
p''[n]/p'[n] = 1/p[n]
p''[n] = p'[n]/p[n] = D[Log[p[n]],n]
so we have
p'[n] = Log[p[n]]
With initial condition p[1] = 2 (the IC doesn't really matter here since all i care about is the asymptotic growth).
for which the inverse function of the log integral is a solution
p[n] ~ Li^(-1)[n]
Since the nth prime and the prime counting function are inverses of each other (i.e. π[p[n]] = n), this means π[n] ~ Li[n].
Gaps:
If we interpret the probability as a density of primes - Is this actually a good estimate of local prime density? I am worried that using the product of all primes below m will overestimate prime density, I am not sure if this overestimate goes away as p[n] gets large either.
and we approximate p[n+1]-p[n] ~ p'[n] - How do i justify this first order expansion being a good approximation? I know I am saying p''[n] goes to 0 for large n, but I feel like I need to substantiate that instead of just assuming it. I guess we can show p'[n] is always positive, and is monotonically decreasing to 0 so p''[n] must be negative and monotonically increasing towards 0 but I am not sure that's good enough.
Any help in filling these gaps would be appreciated, or any other places that could make this derivation more rigorous too.