jetamors: Yoruichi is really hot (Default)
Jetamors ([personal profile] jetamors) wrote in [community profile] intro_to_cs 2010-01-17 12:27 am (UTC)

Oh and now having looked up the sieve of Eratosthenes... that would work fine for problem 2, but I think it would be pretty difficult for problem 1. The trouble is that the sieve assumes that you have a specific largest integer in mind: for example, all the primes between 1 and 300. But for problem 1, we're trying to find our largest integer: the 1000th prime number.

You could probably kludge it by getting, say, every prime number between 1 and 10,000 and then hoping that the 1000th prime is in there. But that would be pretty inefficient.

Post a comment in response:

This community only allows commenting by members. You may comment here if you're a member of intro_to_cs.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting