Guest User

Untitled

a guest
Jun 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. # Project Euler - Problem 7
  2. # By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13,
  3. # we can see that the 6th prime is 13.
  4. # What is the 10001st prime number?
  5.  
  6. # this is slow! lol
  7. require 'mathn'
  8.  
  9. list, gen = [], Prime.new
  10. while(list.size < 10001)
  11. list << gen.succ
  12. p list.last # if you run this in scite it'll show out in output bar
  13. end
Add Comment
Please, Sign In to add comment