Hello everybody, I have been working on prime numbers recently and I have computed a formula for p(n) and pi(n) using Lambert W function. I used the formula from Dusart (2010) which states that pi(n) = n/(log(n)-1) when n > 5393. By inverting this formula, one can find a formula for p(n) : the n'th prime number. p(n) = -n*W(-1,-e/n). It is quite precise, when n=10^24, the approx is 0.999 from the real value, much better than p(n) = n*log(n) (the classical formula).
From that, I worked on a more precise expression by analyzing the remainder which <looks> like a logarithmic curve.
Since the remainder is more or less logarithmic, I put a second term in the first formula which is n/W(0,n) or n/W(n) for short. It gives then p(n) = -n*(W(-1,-exp(1)/n)) - n/W(0,n) Again, by analyzing the remainder, one can find that we still have a logarithmic type of curve (this is like matrioshkas), the russian puppets. Since it looks like a log curve again then I pose p(n) = -n*(W(-1,-exp(1)/n)) - X*n/W(0,n) and solve for each n, here typically X = 0.8 to 1. I use newton bisection method to find X. Once X is found, I calculate the LLS : logarithmic least square curve for X. By using a table for p(n) up to 10^17 , I could calculate (for example ) that p(n) = -n*(W(-1,-exp(1)/n)) - c(n)*n/W(0,n) where c(n) = 0.00074741174603301665420395275429537*ln(n)+0.88596350453664534160747106131754 Once found we can now calculate a few values to see that : it is more precise than the Cipolla-Salvy formula for the n'th prime. Now, since I have a formula for p(n) : if I take the functional inverse I can produce a formula for pi(n) : In short we have : p(n) = -n*(W(-1,-exp(1)/n)) - c(n)*n/W(0,n) pi(n) = {-n*(W(-1,-exp(1)/n)) - c(n)*n/W(0,n)} ^ (-1). The calculation of pi(n) is easy and fast. It is also : more precise than Li(n) , and even <almost> precise as Riemann-R or Gram series. Using a table of p(n) and pi(n) up to 744 billion from 100000 (10^5 ) to 744 billion. the formula for pi(n) has a better average than Riemann R or Gram series. For the scale 10 billion (10^10) up to 10^16 : almost, not as Riemann-R or Gram, but definitively more precise than Li(n). Here are the details of this : http://plouffe.fr/NEW/Une%20formule%20pour%20les%20nombres%20premiers%20II.p... The article is in french, I am working now on the english version. Best regards, Simon Plouffe
participants (1)
-
Simon Plouffe