Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- a = [2, 3, 5, 7]
- def tester(x):
- l = int(math.ceil(math.sqrt(x)))+1
- i = 0
- while a[i] < l:
- if x % a[i] == 0:
- return False
- i += 1
- return True
- for n in xrange(9, 2000000, 2):
- if tester(n):
- a.append(n)
- print a
- print "%d" % len(a)
- print "%d" % sum(a)
Add Comment
Please, Sign In to add comment