Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 Online
OpenStudy (anonymous):

After stumbling upon the Edx Courses, there was one that caught my eye. That one was 6.00x I have a friend that is currently doing an Intro CS Course. And I do help him with the python stuff(Keep in mind it is really basic stuff right now), so I decided I would take a leap of faith and attempt to do this course. After digging through both the '08 and '11 courses I decided I would attempt to do a Problem Set that would require basic python kowledge, but yet be something that isn't as simple as I thought. I decided that I would do the '08 PS1. Finding the 1000th prim number. Though there

OpenStudy (anonymous):

Oh it cut out a lot of my text.

OpenStudy (anonymous):

(Continued from above) Though there are better ways of finding the the nth prime number, I decided to use only basic knowledge. So that I can actually do it. My method is able to find the 1000th prime number in ~1-2 seconds. and find the 10,000th prime number in ~1 min. 55 secs. For learning purposes, is there something I can do using only what I currently have so far to further improve the time it takes to compute the 10k'th prime number? http://pastebin.com/L8ahjEiu

OpenStudy (microbot):

i believe it all has to do with the prime candidate filtering ( count i think in ur case)...im looking into it myself now as mine has the same problem .

OpenStudy (anonymous):

this one is pretty fast http://dpaste.com/806946/

OpenStudy (anonymous):

That is fast. ~14 secs. Just by reducing my range from 2 through count TO: the range of: 2 through sqrt(count) I was able to reduce my time from ~1 min. 55 secs. TO ~38 secs. Quite a bit faster.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!