-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheu10.py
More file actions
22 lines (18 loc) · 695 Bytes
/
eu10.py
File metadata and controls
22 lines (18 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# ----------------------- Summation of primes ------------------------- #
# #
# The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. #
# Find the sum of all the primes below two million. #
# --------------------------------------------------------------------- #
import time
import math
import operator
import functools
from euler import primeSieve
def eu10():
TOP = 2000000
primes = primeSieve(TOP)
return sum(primes)
startTime = time.clock()
print (eu10())
elapsedTime = time.clock() - startTime
print ("Time spent in (", __name__, ") is: ", elapsedTime, " sec")