中文

An Efficient Algorithm for Estimating Prime Counts

数论 2026-06-30 v1

摘要

We propose an efficient algorithm for approximating the prime counting function π(x)\pi(x) using a structured non-uniform partition derived from generalized triangular numbers. The method yields an incremental estimator whose updates require only local computations, resulting in amortized O(1)O(1) update complexity and total complexity O(x)O(\sqrt x). A correction term obtained through extensive numerical experimentation significantly improves the approximation accuracy. Computational tests for values up to 101910^{19} show strong agreement with known values of π(x)\pi(x), with accuracy comparable to classical analytic approximations, while maintaining a substantially simpler incremental evaluation scheme. The proposed framework may be useful in large-scale computational number theory applications requiring fast repeated estimates of π(x)\pi(x).

引用

@article{arxiv.2606.31761,
  title  = {An Efficient Algorithm for Estimating Prime Counts},
  author = {Artur Samojluk and Artur Siemaszko},
  journal= {arXiv preprint arXiv:2606.31761},
  year   = {2026}
}