// you’re reading...
1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 5.00 out of 5)
Loading...

Project Euler Solutions

Project Euler 10 Solution

Project Euler 10 Solution

Project Euler 10: Calculate the sum of all the primes below two million


Problem Description

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

Find the sum of all the primes below two million.

Analysis

Sieve the prime numbers less than 2,000,000 and sum them. Having a fast algorithm to sieve primes helps a solution run under a second.

Project Euler 10 Solution

Runs < 0.090 seconds in Python 2.7.
download arrowUse this link to get the Project Euler 10 Solution Python 2.7 source.

Answer

Slowly swipe from either end beginning with the white vertical bar to get an idea of the starting or ending digits. For less drama, just double click the answer area. The distance between the two bars will give you an idea of the magnitude. Touch devices can tap and hold the center of the box between the two bars and choose define to reveal the answer.
|142913828922|

Afterthoughts

Project Euler 10 Solution last updated

Discussion

No comments yet.

Post a comment