Skip to content

Instantly share code, notes, and snippets.

@joegiralt
Created August 15, 2015 16:37
Show Gist options
  • Save joegiralt/a4e0bcd01ef0e3e55301 to your computer and use it in GitHub Desktop.
Save joegiralt/a4e0bcd01ef0e3e55301 to your computer and use it in GitHub Desktop.
Project Euler 10
def summation_of_primes(up_to_num)
puts (1..up_to_num).map{|num| num if Prime.prime?(num)}.compact!.inject(:+)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment