Sum of Primes

Submitted By:
mstalker

Difficulty:
Medium

Tags:
sum, enumerables, primes, arithmetic

Instructions:
Write some code to sum the first 1000 primes without using Ruby's Prime class.

Hidden Code:
There is hidden code with assertions that is also being run to test out your code.

Code:
def sum_primes(nth_prime)
  ___
end

assert_equal 3682913, sum_primes(1000)
assert_equal 111587, sum_primes(200)

Your Solution

Ruby 1.9.3

Back to Problems