Pith. sign in

REVIEW 2 cited by

Computing $\pi(N)$: An elementary approach in $\tilde{O}(\sqrt{N})$ time

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2212.09857 v4 pith:ACBDFCMO submitted 2022-12-19 math.NT

classification math.NT
keywords tildetimesqrtcomplexitycomputingelementarywhilealgorithm
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
abstract

We present an efficient and elementary algorithm for computing the number of primes up to $N$ in $\tilde{O}(\sqrt N)$ time, improving upon the existing combinatorial methods that require $\tilde{O}(N ^ {2/3})$ time. Our method has a similar time complexity to the analytical approach to prime counting, while avoiding complex analysis and the use of arbitrary precision complex numbers. While the most time-efficient version of our algorithm requires $\tilde{O}(\sqrt N)$ space, we present a continuous space-time trade-off, showing, e.g., how to reduce the space complexity to $\tilde{O}(\sqrt[3]{N})$ while slightly increasing the time complexity to $\tilde{O}(N^{8/15})$. We apply our techniques to improve the state-of-the-art complexity of elementary algorithms for computing other number-theoretic functions, such as the the Mertens function (in $\tilde{O}(\sqrt N)$ time compared to the known $\tilde{O}(N^{0.6})$), summing Euler's totient function, counting square-free numbers and summing primes. Implementation code is provided.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Computation of the Totient Summatory Function

    math.NT 2025-06 conditional novelty 6.0 of 10

    A modified Dirichlet-hyperbola algorithm computes Φ(n) in Θ(n^{2/3}(ln ln n)^{1/3}) time and Θ(n^{1/3}(ln ln n)^{2/3}) space, and produced the first computation of Φ(10^19).

  2. Practical Computations of the Mertens Function: $M(10^{24})$ and $M(10^{25})$

    math.NT 2026-07 accept novelty 4.0 of 10

    M(10^24) = 7,189,337,839 and M(10^25) = -258,560,632,948 are computed using an optimized O(x^{2/3+epsilon}) algorithm, extending the record by two orders of magnitude.

Pith tools