I did problem set 1a after the second lecture and was able to get something to work. After the third lecture, I went back and tried to incorporate some of the new stuff. However, I seem to have a snag that I can't seem to figure out. It does great until x=25. It finds the 24th prime (change x to 24), but when x is 25 it returns 95 as a prime number.
Any thoughts?
x = 25 ##to stop when reaching the Xth prime number
count = 1 ##count starts at one since it will miss 2, the first prime #
prime_n = 1 ##testing number
while (count

MIT 6.00 Intro Computer Science (OCW)
I did problem set 1a after the second lecture and was able to get something to work. After the third lecture, I went back and tried to incorporate some of the new stuff. However, I seem to have a snag that I can't seem to figure out. It does great until x=25. It finds the 24th prime (change x to 24), but when x is 25 it returns 95 as a prime number.
Any thoughts?
x = 25 ##to stop when reaching the Xth prime number
count = 1 ##count starts at one since it will miss 2, the first prime #
prime_n = 1 ##testing number
while (count

MIT 6.00 Intro Computer Science (OCW)
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.