On ps1a, and I don't understand why this returns all of the correct primes... but also a bunch of randomly distributed composite numbers. For example, the first that appears is 95. I know this isn't the best or fastest way to solve this problem, but I don't understand where these random numbers are coming from, it seems like it should work. Can anyone offer any advice? http://pastebin.com/wA2AgDfZ

See more answers at brainly.com

Looking for something else?

Not the answer you are looking for? Search for more explanations.