sorry, possibly too much info. was: Re: How can I speed up a script that iterates over a large range (600 billion)?

Vlastimil Brom vlastimil.brom at gmail.com
Tue Jun 21 17:33:33 EDT 2011


2011/6/21 John Salerno <johnjsal at gmail.com>:
> However, even after reading the Wikipedia page about prime numbers and
> trial division, I'm still a little unclear as to why the square root
> of the number is the upper bound of the range you need to check.
> --

There are likely be some more elaborated proofs, but it seems
sufficiently evident, that with the factors being the square root you
get some kind of "middle position"; with other factors (e.g. two for
simplicity), one of them could be greater, while the another has to be
smaller; this smaller one would have been discovered already, while
searching continuously until the square root of the given number.

vbr



More information about the Python-list mailing list