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
Oh it cut out a lot of my text.
(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
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 .
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.
Join our real-time social learning platform and learn together with your friends!