Now, how the hell did you do that?
Sorry for multi-posting, but I'd like to say it only works until 167, where it mistakens 169 as a prime number.
The method below can be used to find prime numbers greater than 3, the only problem is that it's confusing. I'd like to see someone do this to extend this "table".
You can use the numbers 2 and 3, and keep on adding it by itself, if you find a number that both 2 and 3 skips, then that number is prime.
2,3,5,7,11,13,17,19,23,29,31... the main trouble is what function to use to check the remainder.
So it shouldn't be that hard to do
it only needs to check the primes from 2-31 for each number up to 1000.
You can use this for your homework!!!! +1