[Tutor] checking if a variable is an integer?

Steven D'Aprano steve at pearwood.info
Wed Jun 1 00:22:18 CEST 2011


Rachel-Mikel ArceJaeger wrote:
> Isn't one of the unsolved millenium prize problems one that includes the ability to find all of the prime numbers? I'm not sure if your program is possible if the input number is large.

Finding all the prime numbers isn't hard. Well, it's not hard if you 
have an infinite amount of memory and time :)

But the process for finding them, as many as you want, has been 
well-known since ancient Greece. For big primes, with hundreds of 
digits, it gets a bit slow, but there are tricks to speed it up.

However, discovering a formula that generates the primes and nothing but 
the primes, fast, would be worthy of the Fields Medal (like the Nobel 
Prize for mathematics).



-- 
Steven



More information about the Tutor mailing list