books.google.com - Peter Giblin describes, in the context of an introduction to the theory of numbers, some of the more elementary methods for factorization and primality testing; that is, methods independent of a knowledge of other areas of mathematics. Indeed everything is developed from scratch so the mathematical prerequisites...http://books.google.com/books/about/Primes_and_Programming.html?id=lnbEOBIlZYUC&q=number+of+steps&utm_source=gb-gplus-sharePrimes and Programming