Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 17 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!
Latest Questions
Jalissa21: What does adenoma mea?
28 minutes ago 2 Replies 0 Medals
Twilightt: How Can We Prevent Gun Violence in American Schools?
28 minutes ago 4 Replies 1 Medal
Twaylor: possible?
2 days ago 5 Replies 0 Medals
Arriyanalol: hekp
4 days ago 33 Replies 0 Medals
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!