Factoring and Testing Primes in Small Space

  • Authors:
  • Viliam Geffert;Dana Pardubská

  • Affiliations:
  • Department of Computer Science, P. J. Šafárik University, Košice, Slovakia 04001;Department of Computer Science, Comenius University, Bratislava, Slovakia

  • Venue:
  • SOFSEM '09 Proceedings of the 35th Conference on Current Trends in Theory and Practice of Computer Science
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

We discuss how much space is sufficient to decide whether a unary number n is a prime. We show that O(log log n) space is sufficient for a deterministic Turing machine, if it is equipped with an additional pebble movable along the input tape, and also for an alternating machine, if the space restriction applies only to its accepting computation subtrees. That is, un-Primes is in pebble-DSPACE(log log n) and also in accept-ASPACE(log log n), where un-primes={1 n :n is a prime}. Moreover, if the given n is composite, such machines are able to find a divisor of n. Since O(log log n) space is too small to write down a divisor which might require Ω(log n) bits, the witness divisor is indicated by the input head position at the moment when the machine halts.