Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Problem set 1a
- #Name: ##
- #Time:
- prime_count = 1
- prime_cand = 3
- test_divisor = 2
- while prime_count < 1000:
- while not prime_cand % test_divisor == 0:
- if test_divisor < (prime_cand / 2):
- test_divisor = test_divisor + 1
- else:
- print prime_cand
- prime_cand = prime_cand + 2
- prime_count = prime_count + 1
- test_divisor = 2
- test_divisor = 2
- prime_cand = prime_cand + 2
- print 'The 1000th prime is : ', (prime_cand - 4)
Advertisement
Add Comment
Please, Sign In to add comment