Sieve algorithms for perfect power testing
Rent the article at a discountRent now
* Final gross prices may vary according to local VAT.Get Access
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(log3 n log log logn).
First we improve this worst-case running time toO(log3 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 avoidskth-root 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(log2 n).
Third, we incorporate trial division to give a sieve algorithm with an average running time ofO(log2 n/log2 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.
- Bach, E. (1988) How to generate factored random numbers. SIAM J. Comput. 2: pp. 179-193
- Bach, E., Miller, G., Shallit, J. (1986) Sums of Divisors, perfect numbers, and factoring. SIAM J. Comput. 4: pp. 1143-1154
- Bach, E., Shallit, J. (1989) Factoring with cyclotomic polynomials. Math. Comp. 52: pp. 201-219
- Beame, P. W., Cook, S. A., Hoover, H. J. (1986) Log depth circuits for division and related problems. SIAM J. Comput. 15: pp. 994-1003
- Brent, R. P. Multiple precision zero-finding methods and the complexity of elementary function evaluation. In: Traub, J. F. eds. (1976) Analytical Computational Complexity. Academic Press, New York, pp. 151-176
- A. Cobham. The recognition problem for the set of perfect squares. InProceedings of the 7th Annual Symposium on Switching and Automata Theory, pp. 78–87, 1966.
- Collins, G. E. (1969) Computing multiplicative inverses inGF(p). Math. Comp. 23: pp. 197-200
- Davenport, H. (1980) Multiplicative Number Theory. Springer-Verlag, New York
- Dixon, J. (1981) Asymptotically fast factorization of integers. Math. Comp. 36: pp. 255-260
- S. Goldwasser and J. Kilian. Almost all primes can be quickly certified. InProceedings of the 18th Annual ACM Symposium on Theory of Computing, pp. 316–329, 1986.
- Golomb, S. W. (1973) A new arithmetic function of combinatorial significance. J. Number Theory 5: pp. 218-223
- Hafner, J. L., McCurley, K. S. (1989) On the distribution of running times of certain integer factoring algorithms. J. Algorithms 10: pp. 531-556
- Hardy, G. H., Wright, E. M. (1979) An Introduction to the Theory of Numbers. Oxford University Press, Oxford
- Ireland, K., Rosen, M. (1982) A Classical Introduction to Modern Number Theory. Springer-Verlag, New York
- Jurkat, W. B., Richert, H.-E. (1965) An improvement of Selberg's sieve method I. Acta. Arith. 11: pp. 217-240
- Karp, R., Ramachandran, V. Parallel algorithms for shared memory machines. In: Leeuwen, J. eds. (1990) Algorithms and Complexity. ElsevierMIT Press, AmsterdamCambridge, MA, pp. 871-941
- Knuth, D. E. (1981) The Art of Computer Programming: Seminumerical Algorithms, Volume 2. Addison-Wesley, Reading, MA.
- Knuth, D. E., Pardo, L. Trabb (1976) Analysis of a simple factorization algorithm. Theoret. Comput. Sci. 3: pp. 321-348
- A. K. Lenstra, H. W. Lenstra, Jr., M. S. Manasse and J. M. Pollard. The number field sieve. InProceedings of the 22nd Annual ACM Symposium on Theory of Computing, pp. 564–572, 1990.
- Lenstra, H. W. (1987) Factoring integers with elliptic curves. Ann. of Math. 126: pp. 649-673
- V. Miller. Private communication, 1989.
- C. A. Neff. Specified precision polynomial root isolation is in NC. InProceedings of 31st Annual IEEE Symposium on Foundations of Computer Science, pp. 152–162, 1990.
- V. Pan. Fast and efficient algorithms for sequential and parallel evaluation of polynomial zeros and of matrix polynomials. InProceedings of the 26th Annual IEEE Symposium on Foundations of Computer Science, pp. 522–531, 1985.
- Pollard, J. M. (1974) Theorems on factorization and primality testing. Math. Proc. Cambridge Philos. Soc. 76: pp. 521-528
- Pomerance, C. Fast, rigorous factorization and discrete logarithm algorithms. In: Johnson, D. S., Nishizeke, A., Nozaki, A., Wilf, H. S. eds. (1987) Discrete Algorithms and Complexity: Proceedings of the Japan-US Joint Seminar. Academic Press, Boston, pp. 119-143
- Pritchard, P. (1983) Fast compact prime number sieves (among others). J. Algorithms 4: pp. 332-344
- Rosser, J. B., Schoenfeld, L. (1962) Approximate formulas for some functions of prime numbers. Illinois J. Math. 6: pp. 64-94
- J. Shallit. Course Notes for Number Theory and Algorithms. Dartmouth College, 1989.
- Shoup, V. (1990) On the deterministic complexity of factoring polynomials over finite fields. Inform. Process. Lett. 33: pp. 261-267
- Titchmarsh, E. C. (1930) A divisor problem. Rend. Circ. Mat. Palermo 54: pp. 414-429
- Wagstaff, S. S. (1979) Greatest of the least primes in arithmetic progressions having a certain modulus. Math. Comp. 33: pp. 1073-1080
- Sieve algorithms for perfect power testing
Volume 9, Issue 4 , pp 313-328
- Cover Date
- Print ISSN
- Online ISSN
- Additional Links
- Perfect powers
- Number theoretic algorithms
- Riemann hypothesis
- Newton's method
- Sieve algorithms
- Parallel algorithms
- Average-case analysis
- Industry Sectors