Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import math
- def isPrime(num):
- if num % 2 == 0:return 0
- for x in range(2, int(math.ceil(math.sqrt(num)))+1):
- if ((num % x) == 0):return 0
- return 1
- total = 0
- for x in xrange(5000, 1, -1):
- if(isPrime(x) == 1):total = total + x
- print total + 2
Advertisement
Add Comment
Please, Sign In to add comment