In arithmetic Eratosthenes is noted for the following device , known as the sieve , for finding all the prime numbers less than a given number n. One writes down , in order and starting with 3 , all the odd numbers less than n. The composite numbers in the sequence are then sifted out by crossing off , from 3 , every third number , then from the next remaining number , 5 , every fifth number , then from the next remaining number 7 , every seventh number from the next remaining number 11 every eleventh number , and so on . In the process some numbers will be crossed off more than once. All the remaining numbers , along with the number 2 constitute the list of primes less than n