Skip to content

Instantly share code, notes, and snippets.

@rmm5t
Created April 25, 2013 23:47
Show Gist options
  • Save rmm5t/5464138 to your computer and use it in GitHub Desktop.
Save rmm5t/5464138 to your computer and use it in GitHub Desktop.
Solution to Project Euler #10 http://projecteuler.net/problem=10
#!/usr/bin/env ruby
# http://projecteuler.net/problem=10
require "prime"
max = (ARGV[0] || 2_000_000).to_i
print "Sum of primes below #{max}: "
puts Prime.each(max - 1).inject(&:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment