| |
| | Finding primes & proving primality |
 | | Rather than divide by just the primes, it is sometimes more practical to divide by 2, 3 and 5; and then by all the numbers congruent to 1, 7, 11, 13, 17, 19, 23, and 29 modulo 30--again stopping when you reach the square root. |
 | | For example, to find all the odd primes less than or equal to 100 we first list the odd numbers from 3 to 100 (why even list the evens?) The first number is 3 so it is the first odd prime--cross out all of its multiples. |
 | | To test n for primality (to see if it is prime) just divide by all of the primes less than the square root of n. |
| www.isk.kth.se /kursinfo/6b2025/litterature/finding_primes.html (2205 words) |
|