Guest User

Untitled

a guest
Jun 25th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import math
  2. a = [2, 3, 5, 7]
  3. def tester(x):
  4. l = int(math.ceil(math.sqrt(x)))+1
  5. i = 0
  6. while a[i] < l:
  7. if x % a[i] == 0:
  8. return False
  9. i += 1
  10. return True
  11. for n in xrange(9, 2000000, 2):
  12. if tester(n):
  13. a.append(n)
  14. print a
  15. print "%d" % len(a)
  16. print "%d" % sum(a)
Add Comment
Please, Sign In to add comment