Preprint
Article

This version is not peer-reviewed.

Five Compact Exponential Formulas for the Distribution of Primes

Submitted:

03 July 2025

Posted:

04 July 2025

You are already at the latest version

Abstract
We collect five self-contained closed-form formulas that approximate with high accuracy: (1) the n-th prime pn; (2) the prime-counting function π(x); (3) the logarithm of the primorial pn# in terms of n; and (4)–(5) fast inverses linking pn and π(x). All coefficients depend only on elementary constants (π) and rational numbers. Numerical tests show sub-percent errors from n ≥ 100 or x ≥ 104 upward. No facts about the zeros of the Riemann zeta function are assumed.
Keywords: 
;  

1. Notation

  • p n : the n-th prime.
  • π ( x ) : the number of primes x .
  • p n # : = k = 1 n p k : the primorial of the first n primes.
  • ln ( x ) : the natural logarithm.
  • W ( z ) : Lambert’s W function, defined by W ( z ) e W ( z ) = z .
  • ϑ ( n ) = p n , p prime ln p : the first Chebyshev function.

2. Five Key Formulas

2.1. (F1) p n

p n ( n ln n ) 1 + 1 π 2 ln n 1 8 ln 2 n + 4 / π ln 3 n

2.2. (F2) π ( x )

π ( x ) x ln x 1 1 13 ln x + 9 / π ln 2 x 19 / π ln 3 x

2.3. (F3) ln ( p n # ) from the prime index n

For indices n 100 , the logarithm of the primorial of the n-th prime is well approximated by:
ln ( p n # ) ( ln ( n ! ) ) 1 + 1.301 n

2.4. (F4) Fast inverse p n

n p 1 / C ( n 0 ) ln ( p 1 / C ( n 0 ) ) , where C ( t ) = 1 + 1 π 2 ln t 1 8 ln 2 t + 4 / π ln 3 t and n 0 = p ln p .
A single evaluation of C gives < 0.5 % error for p 2500 .

2.5. (F5) Fast inverse π ( x ) x

x n 1 / E ( x 0 ) W n 1 / E ( x 0 ) / E ( x 0 ) , where E ( t ) = 1 1 13 ln t + 9 / π ln 2 t 19 / π ln 3 t and x 0 = n ln n .
Using the approximation W ( z ) ln z ln ln z keeps the relative error below 0.1 % for n 100 .

3. Links Between ln ( n ! ) and Prime-Sum Functions

A Stirling-based expansion relates the factorial to the Chebyshev function:
ln ( n ! ) = ϑ ( n ) + n ln ln n n + 1 2 ln ( 2 π n ) + O n ln ln n ln n
Alternatively, in an exponential style:
ln ( n ! ) ( ϑ ( n ) ) 1 + ln ln n 1 ln n

4. Numerical Accuracy (brief)

Empirical tests show:
  • Formula (1): relative error < 0.1 % for n 100 .
  • Formula (2): relative error < 0.7 % for 10 4 x 10 5 ; < 0.2 % for x 10 6 .
  • Inverses (F4)–(F5): single-step accuracy 0.5 % (two steps 0.1 % ).
(Detailed tables and code are provided separately.)

5. Concluding Note on the Empirical Derivation

It is important to emphasize that while the formulas presented demonstrate remarkable accuracy in numerical tests, their deduction, including that of the constants, has been empirical in nature. This work is therefore presented as a motivation for the mathematical community. The theoretical foundation explaining this high effectiveness remains an open problem, as does establishing an analytical derivation for the coefficients, potentially connecting them to known mathematical constants.

References

  1. G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed., OUP, 2008.
  2. P. Dusart, “Estimates of some functions over primes”, Math. Comp. 83 (2014), 2113–2144.
  3. J. Cipolla, "Sur la fonction qui donne le nombre des nombres premiers", Bull. Soc. Math. France (1902).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2025 MDPI (Basel, Switzerland) unless otherwise stated