Last active
July 18, 2016 09:23
-
-
Save Nosfheratu/899480ed4825f873363fd6f9582c3b4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prime' | |
primes = [] | |
number_to_compute = 999999999 | |
while true do | |
number_to_compute += 1 | |
primes << number_to_compute if number_to_compute.prime? | |
break if primes.size == 2 | |
end | |
puts primes | |
# => [1000000007, 1000000009] | |
puts primes.last | |
# => 1000000009 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment