Skip to content

Instantly share code, notes, and snippets.

@Nosfheratu
Last active July 18, 2016 09:23
Show Gist options
  • Save Nosfheratu/899480ed4825f873363fd6f9582c3b4c to your computer and use it in GitHub Desktop.
Save Nosfheratu/899480ed4825f873363fd6f9582c3b4c to your computer and use it in GitHub Desktop.
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