1 is not prime (Re: a better prime number generator)

Paul Winkler slinkp23 at yahoo.com
Wed Oct 24 01:58:27 EDT 2001


On Wed, 24 Oct 2001 13:54:16 +1300, Greg Ewing
<greg at cosc.canterbury.ac.nz> wrote:

>Paul Winkler wrote:
>> 
>>     # 1 is prime, but we don't want it in the list during the loop
>>     primes.insert(0, 1)
>The way the primes are usually defined, 1 is
>not considered prime. So this line should be
>removed.

Oops! Right you are.
An interesting text on the subject:
http://www.utm.edu/research/primes/notes/faq/one.html
You can see how long it's been since I've taken a mathematics course!

-- Paul Winkler







More information about the Python-list mailing list