, Volume 9, Issue 4, pp 313328
First online:
Sieve algorithms for perfect power testing
 Eric BachAffiliated withComputer Sciences Department, University of WisconsinMadison
 , Jonathan SorensonAffiliated withDepartment of Mathematics and Computer Science, Butler University
Rent the article at a discount
Rent now* Final gross prices may vary according to local VAT.
Get AccessAbstract
A positive integern is a perfect power if there exist integersx andk, both at least 2, such thatn=x ^{ k }. The usual algorithm to recognize perfect powers computes approximatekth roots fork≤log _{2} n, and runs in time O(log^{3} n log log logn).
First we improve this worstcase running time toO(log^{3} n) by using a modified Newton's method to compute approximatekth roots. Parallelizing this gives anNC ^{2} algorithm.
Second, we present a sieve algorithm that avoidskthroot computations by seeing if the inputn is a perfectkth power modulo small primes. Ifn is chosen uniformly from a large enough interval, the average running time isO(log^{2} n).
Third, we incorporate trial division to give a sieve algorithm with an average running time ofO(log^{2} n/log^{2} logn) and a median running time ofO(logn).
The two sieve algorithms use a precomputed table of small primes. We give a heuristic argument and computational evidence that the largest prime needed in this table is (logn)^{1+O(1)}; assuming the Extended Riemann Hypothesis, primes up to (logn)^{2+O(1)} suffice. The table can be computed in time roughly proportional to the largest prime it contains.
We also present computational results indicating that our sieve algorithms perform extremely well in practice.
Key words
Perfect powers Number theoretic algorithms Riemann hypothesis Newton's method Sieve algorithms Parallel algorithms Averagecase analysis Title
 Sieve algorithms for perfect power testing
 Journal

Algorithmica
Volume 9, Issue 4 , pp 313328
 Cover Date
 199304
 DOI
 10.1007/BF01228507
 Print ISSN
 01784617
 Online ISSN
 14320541
 Publisher
 SpringerVerlag
 Additional Links
 Topics
 Keywords

 Perfect powers
 Number theoretic algorithms
 Riemann hypothesis
 Newton's method
 Sieve algorithms
 Parallel algorithms
 Averagecase analysis
 Industry Sectors
 Authors

 Eric Bach ^{(1)}
 Jonathan Sorenson ^{(2)}
 Author Affiliations

 1. Computer Sciences Department, University of WisconsinMadison, 1210 West Dayton Street, 53706, Madison, WI, USA
 2. Department of Mathematics and Computer Science, Butler University, 4600 Sunset Avenue, 46208, Indianapolis, IN, USA