good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Find prime number between 1 to 1000000by tilly (Archbishop) |
on Jan 24, 2011 at 05:19 UTC ( [id://883853]=note: print w/replies, xml ) | Need Help?? |
For Project Euler problems I already needed an iterator that iterates over primes. (Under the hood it uses the sieve of Eratosthenes to calculate blocks of primes and then returns them.) If you already have that iterator, dividing by the primes up to and including the square root is quite easy.
In Section
Seekers of Perl Wisdom
|
|