. . . both Gauss and lesser mathematicians may be justified in rejoic ing that there is one science [number theory] at any rate, and that their own, whose very remoteness from ordinary human activities should keep it gentle and clean. - G. H. Hardy, A Mathematician's Apology, 1940 G. H. Hardy would have been surprised and probably displeased with the increasing interest in number theory for application to "ordinary human activities" such as information transmission (error-correcting codes) and cryptography (secret codes). Less than a half-century after Hardy wrote the words quoted above, it is no longer inconceivable (though it hasn't happened yet) that the N. S. A. (the agency for U. S. government work on cryptography) will demand prior review and clearance before publication of theoretical research papers on certain types of number theory. In part it is the dramatic increase in computer power and sophistica tion that has influenced some of the questions being studied by number theorists, giving rise to a new branch of the subject, called "computational number theory. " This book presumes almost no background in algebra or number the ory. Its purpose is to introduce the reader to arithmetic topics, both ancient and very modern, which have been at the center of interest in applications, especially in cryptography. For this reason we take an algorithmic approach, emphasizing estimates of the efficiency of the techniques that arise from the theory.