Abstract

Many large arithmetic computations rely on tables of all primes less than nn. For example, the fastest algorithms for computing n!n! takes time O(M(nlog⁡n)+P(n))O(M(n\log n) + P(n)), where M(n)M(n) is the time to multiply two nn-bit numbers, and P(n)P(n) is the time to compute a prime table up to nn. The fastest algorithm to compute (nn/2)\binom{n}{n/2} also uses a prime table. We show that it takes time O(M(n)+P(n))O(M(n) + P(n)). In various models, the best bound on P(n)P(n) is greater than M(nlog⁡n)M(n\log n), given advances in the complexity of multiplication \cite{Furer07,De08}. In this paper, we give two algorithms to computing prime tables and analyze their complexity on a multitape Turing machine, one of the standard models for analyzing such algorithms. These two algorithms run in time O(M(nlog⁡n))O(M(n\log n)) and O(nlog⁡2n/log⁡log⁡n)O(n\log^2 n/\log \log n), respectively. We achieve our results by speeding up Atkin's sieve. Given that the current best bound on M(n)M(n) is nlog⁡n2O(log⁡∗n)n\log n 2^{O(\log^*n)}, the second algorithm is faster and improves on the previous best algorithm by a factor of log⁡2log⁡n\log^2\log n. Our fast prime-table algorithms speed up both the computation of n!n! and (nn/2)\binom{n}{n/2}. Finally, we show that computing the factorial takes Ω(M(nlog⁡4/7−εn))Ω(M(n \log^{4/7 - ε} n)) for any constant ε>0ε> 0 assuming only multiplication is allowed.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.