I don't understand iterating over all the factors and all the possible numbers for every prime candidate. Doesn't it waste time doing tests on 4, 6, 9, and 64... when you already know 2 and 3 are factors and, therefore the candidate isn't prime?
#problem 1
isprime = [2] #initializes the list of primes
i = 3
while len(isprime) < 1000: #continue until 1000th prime
prime = True #assume i is prime
for j in isprime: #compare it to the list
if i%j == 0: #to see if it divides evenly
prime = False
else:
pass
if prime:
isprime.append(i) #if it doesn't, add it to the list
i += 1
print isprime[-1]
#problem 2
isprime = [2]
for i in range (3, n, 2):
prime = True
for j in isprime:
if i%j == 0:
prime = False
else:
pass
if prime:
isprime.append(i) #like above, collect all the primes
j = 0
for prime in isprime:
j = j + log(prime) #calculate the log of the sum of 'em
print 'The sum of the log of primes <= n is:',j
print 'n is:', n
print 'The ratio is:',j/n