View difference between Paste ID: EyghwVtY and 8en99qvn
SHOW: | | - or go back to the newest paste.
1
#Problem set 1a
2-
#Name: ###
2+
#Name: ##
3-
#Time: 8:15 - 
3+
#Time:  
4
5
prime_count = 1
6
7
prime_cand = 3
8-
test_no = 3
8+
9
test_divisor = 2
10
11
while prime_count < 1000:
12
	while not prime_cand % test_divisor == 0:
13-
	if not test_no % test_divisor == 0:
13+
		if test_divisor < (prime_cand / 2):
14-
		#print 'divisor: ', test_divisor
14+
15-
		if test_divisor < (test_no / 2) :
15+
16
			print prime_cand
17
			prime_cand = prime_cand + 2
18-
			# prime number
18+
19-
			print test_no
19+
20-
			test_no = test_no + 2
20+
			
21
	test_divisor = 2
22
	prime_cand = prime_cand + 2
23
	
24-
	else:
24+
print 'The 1000th prime is : ', (prime_cand - 4)