Submitted:
26 June 2025
Posted:
27 June 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Six Exact Formulations
2.1. Floor-Function Indicator
2.2. Roots-of-Unity (Complex Exponential) Indicator
2.3. Primorial and GCD Model
2.4. Wilson’s Theorem (Roots of Unity)
2.5. Aggregated Fermat Test
2.6. Discrete Derivative (Prime Counting)
3. Numerical Examples
- Floor-Function:
- Roots-of-Unity: , (by evaluation of the exponential sums).
- Primorial GCD: ; , .
- Wilson: , .
- Aggregated Fermat: , .
- Discrete Derivative: , .
4. Complexity Comparison Table
| Formulation | Dominant Operation | Practical Efficiency |
| Floor-function | Division, floor | |
| Roots of unity | Exponential sum | (slower constants) |
| Primorial GCD | List of primes up to , GCD | |
| Wilson | Factorial, sum | (factorial cost) |
| Aggregated Fermat | Exponentiation | (not efficient) |
| Discrete Derivative | As above | As above |
5. Discussion
6. Conclusions
References
- C. P. Willans, “On formulae for the nth prime number,” Mathematical Gazette, 48(363), 1964.
- G. H. Hardy, E. M. Wright, An Introduction to the Theory of Numbers, Oxford, 1979.
- R. Crandall, C. Pomerance, Prime Numbers: A Computational Perspective, Springer, 2001.
- Math StackExchange, “Proof for a relation between prime numbers and roots of unity.” https://math.stackexchange.com/questions/1723456/proof-for-a-relation-between-prime-numbers-and-roots-of-unity.
- C. F. Gauss, Disquisitiones Arithmeticae, 1801.
- P. G. L. Dirichlet, “Über die Bestimmung der mittleren Werthe in der Zahlentheorie,” Abhandlungen der Königlichen Akademie der Wissenschaften zu Berlin, 1849.
- Wilson indicator and algebraic sum, see also OEIS A007635.
- K. Giuga, “Su una presumibile proprietà caratteristica dei numeri primi,” Ist. Lombardo Sci. Lett. Rend. A, 83, 511-528, 1949.
- See also: https://en.wikipedia.org/wiki/Giuga_number.
- For variants and discussion, see OEIS A000720, Wikipedia “Sieve of Eratosthenes,” and “Formula for primes.”.
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. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).