Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Project Euler - Problem 7
- # 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?
- # this is slow! lol
- require 'mathn'
- list, gen = [], Prime.new
- while(list.size < 10001)
- list << gen.succ
- p list.last # if you run this in scite it'll show out in output bar
- end
Add Comment
Please, Sign In to add comment