On PS1. Computing 1000th prime. I am confused by the hint to generate all odd integers>1 as candidates to be prime. Obviously "generating" here cannot mean including all odd positive integers into some range, array, list or tuple, because it would be infinitely large. So my question is what does "generating" mean here? Just "if" condition?
you have to provide your program with numbers to test you have to keep providing numbers to test until you don't need any more for this problem, since you don't know in advance how many numbers you need to provide, you need to be prepared to provide All of them. if you are going to use a data structure (like a list), you could limit its size by generating x numbers then if that wasn't enuff you could generate x more - but that seems to be a bit complicated
got it, thanks a lot
Join our real-time social learning platform and learn together with your friends!