can somebody help me with PS1? I keep getting Memory Error.... Thanks!
n = 1000
n = n - 1 # not counting 2 (the only even prime)
counter = 1
prime = 3 # 3 is 2nd prime
divisor = [2, ]
answers = []
while counter <= n:
for div in divisor:
ans = prime % div
answers.append(ans)
if sum(answers) != 0:
counter = counter + 1
divisor.append(prime)
answers = [] # reset answers list to 0 elements
prime = prime + 2 # next odd number (after 2, all primes are odd
print prime

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.