Cody

Problem 2337. Sum of big primes without primes

Inspired by Project Euler n°10 (I am quite obviously a fan).

With problem n°250 by Doug, you can find some global methods to compute the sum of all the primes below the input n.

For example, the sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

But how to proceed (in time) with big number and WITHOUT the primes function ?

HINTS: sum(primes(n)) is possible here but why miss the wonderfull Sieve of Eratosthenes ?

http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

Solution Stats

78.79% Correct | 21.21% Incorrect
Last solution submitted on Oct 14, 2019

Solution Comments