LYCOS RETRIEVER
Prime Numbers: Divisors
built 649 days ago
The method handles the special case of 2 (which is prime). It then screens out other positive even numbers (which are not prime, because they have 2 as a divisor). The isPrime method then tries odd divisors starting at 3 and going up to the square root of the number.
Source:
Choice #2 is keeping the prime list on disk. No memory problems, no need to pre-estimate the number of primes. What a deal. Except that the time taken to recover these numbers to use them as divisors would slow the program horribly.
Source:
A natural number greater than 1 that has no divisor between 1 and itself is said to be prime, hence called a prime number or simply a prime. Every natural number greater than 1 has at least the two distinct divisors 1 and itself; a prime has no others.
Source: