Sum of Primes
sum, enumerables, primes, arithmetic
Write some code to sum the first 1000 primes without using Ruby's Prime class.
There is hidden code with assertions that is also being run to test out your code.
def sum_primes(nth_prime) ___ end assert_equal 3682913, sum_primes(1000) assert_equal 111587, sum_primes(200)
Back to Problems