Overview

 

Question

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10001st prime number?

click for answer

104743

Solutions

 

Ruby

 find_prime.rb https://raw.github.com/addamh/euler/master/007/find_prime.rb download
#!/usr/bin/env ruby
require 'mathn'
puts Prime.take(10001).last
$ time ruby find_prime.rb
real	0m0.405s
user	0m0.398s
sys	0m0.005s