Created
April 25, 2013 23:47
-
-
Save rmm5t/5464138 to your computer and use it in GitHub Desktop.
Solution to Project Euler #10
http://projecteuler.net/problem=10
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
#!/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