While we are talking about prime numbers, there is another general rule for identifying whether a positive integer 'N' is prime or not:
Take square root of N, and if its not an integer, round it down to nearest integer. Let that integer be M. Now divide N by all the prime numbers between 1 and M exclusive,
and if its NOT divisible by either of those, then N must be prime.
Eg, lets see if 199 and 299 are prime or not. Lets start with 199.
Square root of 199 when rounded down to nearest integer = 14 (14^2 = 196).
Now we should check if 199 is divisible by any prime number between 1 and 14.. these prime numbers are 2, 3, 5, 7, 11, 13.
199 is NOT divisible by any of these - hence 199 is prime.
Lets now look at 299. Square root of 299 rounded down to nearest integer = 17 (17^2 = 289).
Now we should check if 299 is divisible by any prime number between 1 and 17.. these prime numbers are 2, 3, 5, 7, 11, 13.
But 299 is Divisible by 13. (13*23).. we found a factor - hence 299 is NOT prime