Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
- #Find the sum of all the primes below two million.
- require 'mathn'
- p (Prime.take_while{|p| p<2000000}).inject(0) {|sum,item| sum+item}
Add Comment
Please, Sign In to add comment