Skip to content

Instantly share code, notes, and snippets.

@sferik
Created April 12, 2013 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sferik/5368723 to your computer and use it in GitHub Desktop.
Save sferik/5368723 to your computer and use it in GitHub Desktop.
require 'prime'
t = Time.now
Prime.each_with_index.inject(0) do |sum, (number, index)|
puts "#{index + 1} (took #{Time.now - t} seconds)" if sum % number == 0
sum += number
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment