arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.09857math.NT
收藏

计算 $π(N)$:一种 $\tilde{O}(\sqrt{N})$ 时间的初等方法

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

Dean Hirsch, Ido Kessler, Uri Mendlovic

AI总结:

本文提出一种 $\tilde{O}(\sqrt N)$ 时间的初等素数计数算法,避免复分析并支持空间-时间权衡,同时改进了多个数论函数的初等计算复杂度。

摘要:

我们提出一种高效且初等的算法,用于在 $\tilde{O}(\sqrt N)$ 时间内计算不超过 $N$ 的素数个数,改进了现有需要 $\tilde{O}(N^{2/3})$ 时间的组合方法。我们的方法在时间复杂度上与素数计数的解析方法相近,同时避免了复分析和任意精度复数运算。虽然我们算法中时间效率最高的版本需要 $\tilde{O}(\sqrt N)$ 空间,但我们给出了一种连续的空间-时间权衡,例如说明如何将空间复杂度降低到 $\tilde{O}(\sqrt[3]{N})$,同时将时间复杂度略微提高到 $\tilde{O}(N^{8/15})$。我们应用这些技术改进了用于计算其他数论函数的初等算法的最先进复杂度,例如 Mertens 函数(时间为 $\tilde{O}(\sqrt N)$,而已知方法为 $\tilde{O}(N^{0.6})$)、对 Euler 欧拉函数求和、统计无平方因子数以及对素数求和。文中提供了实现代码。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑