- Testing for Primality
Since ancient times, mathematicians have been fascinated by problems concerning prime numbers, and many people have worked on the problem of determining ways to test if numbers are prime. One way to test if a number is prime is to find the number's divisors. The following program finds the smallest integral divisor (greater than 1) of a given number n. It does this in a straightforward way, by testing n for divisibility by successive integers starting with 2. http://www-mitpress.mit.edu/sicp/chapter1/node17.html (Added: Thu Jan 01 2004 Hits: 0 Rating: 0.00 Votes: 0)
Rate It
Review It |