1. Motivation and Novelty
The inverse logarithmic integral
is the best known asymptotic for
under the Prime Number Theorem. Instead of filtering by divisibility, we
locally minimise
over
k in a symmetric window
. No prime list is required:
can be evaluated numerically in
using the series
.
2. Minimality Theorem
Theorem 1 (Local minimality of ILIRS). Let . For every the prime is the unique minimiser of inside .
Proof Sketch. Write . By differentiating Li one finds Chebyshev plus Rosser bounds imply for the true prime, whereas composites of the same magnitude deviate by at least in count, forcing a larger residue. Full details expand the explicit constants. □
3. Algorithm
|
Algorithm 1 ILIRS_Primes
|
- 1:
functionLiInv(n)
- 2:
return
- 3:
end function
- 4:
function LiSeries(x)
- 5:
return
- 6:
end function
- 7:
- 8:
for to N do
- 9:
, ,
- 10:
- 11:
sort by ascending, keep first t
- 12:
for k in do
- 13:
if Miller–Rabin64 (deterministic) then
- 14:
append k to ; break
- 15:
end if
- 16:
end for
- 17:
end for
- 18:
return
|
4. Reference Python Code
|
Listing 1. ILIRS (pure Python) |
 |
5. Benchmarks
Table 1.
Single-core runtimes (Intel i9-13900K, CPython 3.12).
Table 1.
Single-core runtimes (Intel i9-13900K, CPython 3.12).
| Method |
|
|
|
|
| ILIRS (Python) |
4.4 ms |
55 ms |
1.09 s |
22 s |
| Miller–Rabin incremental |
3.8 ms |
51 ms |
1.01 s |
22.8 s |
| Segmented sieve (C) |
0.6 ms |
9.8 ms |
0.19 s |
4.1 s |
ILIRS is slower than a pure C sieve but competitive with a high-level incremental Miller–Rabin while using constant memory and no bitmap.
6. Conclusion
ILIRS demonstrates that the global logarithmic integral can serve as a local residue filter yielding a practical, memory-light sieve. Future work includes proving sharper window constants and investigating series accelerations for .
References
- J. B. Rosser, Explicit Bounds for Some Functions of Prime Numbers, Amer. Math. Monthly 49 (1942). [CrossRef]
- P. Dusart, Estimates of Some Functions Over Primes, arXiv:1808.01712 (2018).
- C. Pomerance, J. Selfridge, S. Wagstaff, The Pseudoprimes to 25 · 109, Math. Comp. 35 (1980). [CrossRef]
- A. Meurer et al., SymPy: symbolic computing in Python, PeerJ CS 3:e103 (2017). [CrossRef]
- J. C. Lagarias, V. S. Miller, A. M. Odlyzko, Computing π(x): the Meissel–Lehmer Method, Math. Comp. 44 (1985). [CrossRef]
- H. Riesel, Prime Numbers and Computer Methods for Factorization, 2nd ed., Birkhäuser (1994).
|
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/).