Next Article in Journal
Quasirecognition by Prime Graph of the Groups 2D2n(q) Where q < 105
Next Article in Special Issue
Quiver Gauge Theories: Finitude and Trichotomoty
Previous Article in Journal
On Small Deviation Asymptotics In L2 of Some Mixed Gaussian Processes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Primes and the Lambert W function

School of Mathematics and Statistics, Victoria University of Wellington, P.O. Box 600, Wellington 6140, New Zealand
Mathematics 2018, 6(4), 56; https://doi.org/10.3390/math6040056
Submission received: 24 March 2018 / Revised: 1 April 2018 / Accepted: 2 April 2018 / Published: 8 April 2018

Abstract

:
The Lambert W function, implicitly defined by W ( x ) e W ( x ) = x , is a relatively “new” special function that has recently been the subject of an extended upsurge in interest and applications. In this note, I point out that the Lambert W function can also be used to gain a new perspective on the distribution of the prime numbers.
MSC:
11A41 (Primes); 11N05 (Distribution of primes)

1. Introduction

The Lambert W function, implicitly defined by the relation W ( x ) e W ( x ) = x , has a long and quite convoluted 250-year history, but only recently has it become common to view this particular function as one of the standard “special functions” of mathematics [1]. Applications range over an extremely broad range [1,2], from combinatorics (for instance in the enumeration of rooted trees) [1], to delay differential equations [1], to falling objects subject to linear drag [3], to the evaluation of the numerical constant in Wien’s displacement law [4,5], to quantum statistics [6], to constructing the “tortoise” coordinate for Schwarzschild black holes [7], etcetera. In this brief note I will indicate some apparently new applications of the Lambert W function to the distribution of primes, specifically to the prime counting function π ( x ) and estimating the n’th prime p n .

2. The Prime Counting Function π ( x )

Theorem 1.
The prime counting function π ( x ) satisfies
π ( x ) < x W ( x ) = e W ( x ) ; ( x 0 ) .
Proof. 
First observe that x p π ( x ) . Second recall the standard result that p n > n ln n for n 1 . (See Rosser [8], or any standard reference book on prime numbers, for example [9,10].) Then we have x p π ( x ) > π ( x ) ln π ( x ) , so implying x > π ( x ) ln π ( x ) . Invert, noting that the right hand side (RHS) is monotone increasing, to see that π ( x ) < x / W ( x ) , certainly for π ( x ) 1 (corresponding to x 2 ). Then explicitly check validity of the inequality on the domain x [ 0 , 2 ) . Finally, use the definition of the Lambert W function to note x / W ( x ) = e W ( x )  ☐
Corollary 1.
ln π ( x ) < W ( x ) ; ( x 0 ) .
Theorem 2.
The prime number theorem, π ( x ) x / ln x , is equivalent to the statement
π ( x ) x W ( x ) = e W ( x ) ; ( x ) .
Proof. 
Trivial. Note that asymptotically W ( x ) ln x . (The only potential subtlety is that we are using the principal branch of the W function, denoted W 0 ( x ) whenever there is any risk of confusion [1].) ☐
Corollary 2.
ln π ( x ) W ( x ) ; ( x ) .
So we have derived both a strict upper bound on π ( x ) and an asymptotic equality. This is, so far, essentially a re-packaging of well-known results in terms of the Lambert W function.
When it comes to developing an analogous lower bound on π ( x ) , the situation is considerably more subtle. First consider the well-known upper bound on p n [9,10,11]:
p n < n ( ln n + ln ln n ) = n ln ( n ln n ) ; ( n 6 ) .
Note that x < p π ( x ) + 1 . Now consider the elementary inequality
ln x x e ,
with equality only at x = e , and observe that (here and below we shall generically use ϵ to represent an arbitrarily small positive number) this implies
ln x = ln ( x ϵ ) ϵ x ϵ ϵ e ; ( ϵ > 0 ) ,
now with equality only at x = e 1 / ϵ . This inequality explicitly captures the well-known fact that the logarithm grows less rapidly than any positive power. Applied to the n’th prime this now implies
p n < n ln ( n ln n ) n ln n 1 + ϵ ϵ e = n { ( 1 + ϵ ) ln n 1 ln ϵ } ; ( n 6 ; ϵ > 0 ) .
The inequality p n < n { ( 1 + ϵ ) ln n 1 ln ϵ } is much weaker than Equation (5), but much more tractable. Using logic identical to that of Theorem 1, it is easy to convert this into the inequality
x p π ( x ) + 1 < [ π ( x ) + 1 ] ln [ π ( x ) + 1 ] 1 + ϵ ϵ e ; ( π ( x ) 5 ; ϵ > 0 ) .
This is now easily inverted to obtain:
Theorem 3.
The prime counting function π ( x ) satisfies ( x 11 ; ϵ > 0 ):
π ( x ) > x 1 + ϵ W x 1 + ϵ ( ϵ e ) 1 / ( 1 + ϵ ) 1 = ( ϵ e ) 1 / ( 1 + ϵ ) exp W x 1 + ϵ ( ϵ e ) 1 / ( 1 + ϵ ) 1 .
For any fixed ϵ > 0 , this it is easy to check that inequality holds at least for π ( x ) 5 , corresponding to x 11 . But, depending on the specific value ϵ , the domain of validity may actually be larger. That is, ϵ > 0 the inequality holds for π ( x ) n 0 ( ϵ ) with n 0 ( ϵ ) 5 , corresponding to x x 0 ( ϵ ) with x 0 ( ϵ ) < 11 . For instance, numerically solving 1 1 + ϵ ( ϵ e ) 1 / ( 1 + ϵ ) = 1 gives ϵ = 0.2711715619 , whence 1 1 + ϵ = ( ϵ e ) 1 / ( 1 + ϵ ) = 0.7866758744 . (As always, there is a trade-off between the tightness of the bound and domain of validity of the bound; sometimes it is worthwhile to consider a simpler less-stringent bound that is valid over a wider domain; sometimes it is worthwhile to consider an uglier but tighter bound that might be valid over a smaller domain).
Corollary 3.
After explicitly checking the domain of validity we have:
π ( x ) > x ( 1 + ϵ ) W ( x ) 1 = exp W ( x ) 1 + ϵ 1 ; ( x 3 ) .
where numerically 1 1 + ϵ = 0.7866758744 .
The particular corollary above has perhaps the best trade-off in terms of elegance and wide domain of validity. Other related corollaries, again chosen for their (comparative) elegance and wide domain of applicability, may be determined analytically:
Corollary 4.
Setting ϵ = 1 , and explicitly checking the domain of validity, we have:
π ( x ) > x / 2 W x 2 e 1 / 2 1 = e 1 / 2 exp W x 2 e 1 / 2 1 ; ( x 6 ) .
Corollary 5.
Choosing the specific case ϵ = e 1 , and explicitly checking the domain of validity, we have:
π ( x ) > x 1 + e 1 W x 1 + e 1 1 = exp W x 1 + e 1 1 ; ( x 5 ) .
Corollary 6.
Choosing the specific case ϵ = e 3 , the domain of validity is the entire positive half line ( x 0 ):
π ( x ) > x 1 + e 3 W x 1 + e 3 e 2 / ( 1 + e 3 ) 1 = e 2 / ( 1 + e 3 ) exp W x 1 + e 3 e 2 / ( 1 + e 3 ) 1 .
This last of these corollaries, ( ϵ = e 3 ), exhibits somewhat poorer bounding performance at intermediate values of x, but eventually overtakes corollary 5, ( ϵ = e 1 ), once x e 2 e + 3 4600 , and then asymptotically provides a better bound. Numerous variations on this theme can also be constructed, amounting to different ways of approximating the logarithms appearing in Equation (5).
In summary, we have used the Lambert W function to obtain a number of bounds, and some general classes of bounds, on the prime counting function π ( x ) in terms of the Lambert W function W ( x ) . We shall now turn attention to the n’th prime p n .

3. The n ’th Prime

Theorem 4.
The n’th prime p n satisfies
p n < n W 1 1 n ; ( n 4 ) .
Here W 1 ( x ) is the second real branch of the Lambert W function, which is a strictly negative function defined on the domain x [ 1 / e , 0 ) .
Proof. 
We start from the fact that n p n / ln p n , this inequality certainly being valid for p n 7 , corresponding to n 4 [12]. Inverting, (and appealing to the monotonicity of x / ln x ), we have p n < n W 1 ( 1 / n ) , certainly for n 4 . Explicitly inspecting n { 1 , 2 , 3 } shows that the actual domain of validity is indeed n 4 . ☐
Corollary 7.
p n < n W 1 1 n + e ; ( n 1 ) .
Proof. 
Note that the function W 1 ( x ) is monotone increasing on [ e 1 , 0 ) . So we see that W 1 ( 1 / [ n + e ] ) > W 1 ( 1 / n ) , and the claimed inequality certainly holds for n 4 . For n { 1 , 2 , 3 } verify the claimed inequality by explicit computation. ☐
The virtue of this specific corollary is that it now holds for all positive integers.
There are many other variations on this theme that one could construct.
Theorem 5.
The prime number theorem, which can be written in the form p n n ln n , is equivalent to the statement
p n n W 1 1 n ; ( n ) .
Proof. 
Trivial. Consider the asymptotic result [1]
W 1 ( x ) = ln ( x ) ln ( ln ( x ) ) + o ( 1 ) ( x 0 ) .
Then
n W 1 1 n = n { ln n + ln ln n + o ( 1 ) } .
 ☐
Comment: Note that use of the Lambert W function, simply because its asymptotic expansion contains both ln ( x ) and ln ( ln ( x ) ) terms, automatically yields the first two terms of the Cesàro–Cippola asymptotic expansion [13,14]:
p n = n { ln n + ln ln n 1 + o ( 1 ) } .
We can even obtain the first three terms of the Cesàro–Cippola asymptotic expansion by refining the prime number theorem slightly as follows:
Theorem 6.
p n n W 1 e n ; ( n ) .
We note that use of the Lambert W function yields both a strict upper bound and an asymptotic result.
In counterpoint, to obtain a lower bound on p n we start with an upper bound on π ( x ) . Consider for instance the standard result [15]:
π ( x ) < x ln x 3 2 ; ( x > e 3 / 2 )
Note that the RHS of this inequality is monotone increasing for x > e 5 / 2 . Now we always have p π ( x ) x < p π ( x ) + 1 , so
n < p n + 1 ln p n + 1 3 2 .
This holds at the very least for p n > e 5 / 2 , corresponding to n 6 , but an explicit check shows that it in fact holds for n 2 . This is perhaps more clearly expressed as
n 1 < p n ln p n 3 2 ; ( n 3 ) .
Inverting, and noting the constraint arising from the domain of definition of W 1 , we now obtain:
Theorem 7.
p n > ( n 1 ) W 1 e 3 / 2 n 1 ; ( n 14 ) .
There are many other variations on this theme that one could construct.
To find some implicit bounds we use the old result (see for example Rosser [11]) that ϵ > 0 , N ( ϵ ) : n N ( ϵ )
x ln x 1 + ϵ < π ( x ) < x ln x 1 ϵ .
Without an explicit calculation of N ( ϵ ) these bounds are qualitative, rather than quantitative. Nevertheless it may be of interest to point out that a minor variant of the arguments above immediately yields:
Theorem 8.
ϵ > 0 , M ( ϵ ) : n M ( ϵ )
n W 1 e 1 ϵ n > p n > ( n 1 ) W 1 e 1 + ϵ n 1 .
It is now “merely” a case of estimating M ( ϵ ) to turn these into explicit bounds. We have already seen that ϵ = 1 provides a widely applicable upper bound, and ϵ = 1 / 2 a widely applicable lower bound. Taking ϵ 0 now makes it clear why
p n n W 1 e n ; ( n ) ,
is such a good asymptotic estimate for p n .

4. Discussion

While the calculations carried out above are very straightforward, almost trivial, it is perhaps the shift of viewpoint that is more interesting. The Lambert W function provides (in this context) a “new” special function to work with, one which may serve to perhaps simplify and unify many otherwise disparate results. It is perhaps worth noting that the infamous “ ln ln x ” terms that infest the analytic theory of prime numbers will automatically appear as the sub-leading terms in asymptotic expansions of the Lambert W function. Whether there is anything “deeper” at play will be deferred for future investigation.

Acknowledgments

This research was supported by the Marsden Fund, and by a James Cook fellowship, both administered by the Royal Society of New Zealand.

Conflicts of Interest

The author declares no conflict of interest.

Appendix A. The Lambert W Function

The Lambert W function is a multi-valued complex function defined implicitly by [1]
W ( x ) e W ( x ) = x .
There are two real branches: W 0 ( x ) defined for x [ e 1 , ) , and W 1 ( x ) defined for x [ e 1 , 0 ) . These two branches meet at the common point W 0 ( e 1 ) = W 1 ( e 1 ) = 1 . It is common to use W ( x ) in place of W 0 ( x ) when there is no risk of confusion.
Asymptotic expansions are [1]:
W 0 ( x ) = ln x ln ln x + o ( 1 ) ; ( x ) ;
W 1 ( x ) = ln ( x ) ln ( ln ( x ) ) + o ( 1 ) ; ( x 0 ) .
More details, and a Taylor expansion for | x | < e 1 , can be found in Corless et al. [1]. A key identity is:
ln ( a + b x ) + c x = ln d x = 1 c W c d b exp a c b a b .

References

  1. Corless, R.M.; Gonnet, G.H.; Hare, D.E.G.; Jeffrey, D.J.; Knuth, D.E. On the Lambert W function. Adv. Comput. Math. 1996, 5, 329–359. [Google Scholar] [CrossRef]
  2. Valluri, S.R.; Jeffrey, D.J.; Corless, R.M. Some Applications of the Lambert W Function to Physics. Can. J. Phys. 2000, 78, 823–831. [Google Scholar] [CrossRef]
  3. Vial, A. Fall with linear drag and Wien’s displacement law: Approximate solution and Lambert function. Eur. J. Phys. 2012, 33, 751. [Google Scholar] [CrossRef]
  4. Stewart, S.M. Wien Peaks and the Lambert W Function. Rev. Bras. Ensino Física 2011, 33, 3308. Available online: www.sbfisica.org.br (accessed on 5 April 2018). [CrossRef]
  5. Stewart, S.M. Spectral Peaks and Wien’s Displacement Law. J. Therm. Heat Transfer 2012, 26, 689–692. [Google Scholar] [CrossRef]
  6. Valluri, S.R.; Gil, M.; Jeffrey, D.J.; Basu, S. The Lambert W function and quantum statistics. J. Math. Phys. 2009, 50, 102103. [Google Scholar] [CrossRef]
  7. Boonserm, P.; Visser, M. Bounding the greybody factors for Schwarzschild black holes. Phys. Rev. D 2008, arXiv:0806.220978, 101502. [Google Scholar] [CrossRef]
  8. Barkley Rosser, J. The n’th Prime is Greater than n ln n. Proc. Lond. Math. Soc. 1938, 45, 21–44. [Google Scholar]
  9. Ribenboim, P. The Little Book of Big Primes; Springe: New York, NY, USA, 1991. [Google Scholar]
  10. Ribenboim, P. The New Book of Prime Number Records; Springer: New York, NY, USA, 1996. [Google Scholar]
  11. Barkley Rosser, J. Explicit Bounds for some functions of prime numbers. Am. J. Math. 1941, 64, 211–232. [Google Scholar] [CrossRef]
  12. Dusart, P. The kth prime is greater than k(ln k + ln ln k − 1) for k ≥ 2. Math. Comput. 1999, 68, 411–415. [Google Scholar] [CrossRef]
  13. Cesàro, E. Sur une formule empirique de M. Pervouchine. Comptes rendus 1894, 119, 848–849. (In French) [Google Scholar]
  14. Cipolla, M. La determinazione assintotica dell’nimo numero primo. Mat. Nap. 1902, 3, 132–166. (In Italian) [Google Scholar]
  15. Barkley Rosser, J.; Schoenfeld, L. Approximate Formulas for Some Functions of Prime Numbers. Ill. J. Math. 1962, 6, 64–97. [Google Scholar]

Share and Cite

MDPI and ACS Style

Visser, M. Primes and the Lambert W function. Mathematics 2018, 6, 56. https://doi.org/10.3390/math6040056

AMA Style

Visser M. Primes and the Lambert W function. Mathematics. 2018; 6(4):56. https://doi.org/10.3390/math6040056

Chicago/Turabian Style

Visser, Matt. 2018. "Primes and the Lambert W function" Mathematics 6, no. 4: 56. https://doi.org/10.3390/math6040056

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop