lifeclot // say all that you can. . .

10,000,001st Prime

Friday, December 25, 2009Miscellaneous

Yeah, yeah everyone already has the ability to lookup the 10,000,001st Prime Number (Google: Big Primes).

However, I wrote a script to take on a question on Project Euler to figure out the 10,001st Prime Number. Not terribly complicated, but I changed a parameter and had my script look up the 10,000,001st Prime.

Output:

Finding the ten million and first prime number

10000001th prime: 179424691

Took 13598.682585955 secs

That’s 3 hours and 46 minutes. Wooooo, right? Pretty nifty still, I’d say.

Also, while using the trial division method, apparently you only have to divide by prime numbers smaller than the square root of n. My script does not take this into account and tries all numbers smaller than the square root of n.

Oh yeah, Merry Christmas.

Leave a Reply

You must be logged in to post a comment.