A number p is a prime if it has exactly two factors; namely 1 and p. In other words, the only factors of a prime are the trivial factor and the improper factor.
A number that has a nontrivial proper factor is said to be composite.
The number 1, therefore, is neither a prime nor a composite. All other numbers which are not prime are composite. The number 2 is the smallest prime.
6 is composite, as 6 = 2×3. The numbers 2 and 3 are non-trivial proper factors of 6.
The numbers 2, 3, 5 and 7 are prime.
Let's look at a good method for discovering small primes:
Eratosthenes’s Sieve Method
Suppose we are trying to discover all prime numbers ≤ M.
We demonstrate the process with numbers less than 50.