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

I solved ps1a for the 2008 course in an alternative way rather than checking up to the sqrt(n). I filled a list with 10000 True values. I then created false values at the index i*j where i and j are [1:10000]. Any position at i*j cannot be a prime. Here's the code: http://dpaste.com/hold/786499/ I know it's not conventional, but for short lists of prime numbers it might be faster. Does anybody know a way to test this code against the conventional sqrt(n) method?

OpenStudy (anonymous):

Here is my conventional way of solving ps1a by checking n up to sqrt(n): http://dpaste.com/hold/786503/

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!