Take the large number (n) and find the primes within it through the Sieve of Eratosthemes process. In this example, we will use 35 as n.
Write down all of the numbers between two and 35.
Use the first prime number, which is two, to strike out all potential primes less than. Continually multiply by two and strike out each number less than 35. The result is that the following numbers are not prime:
4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34
Use the second prime number, which is three, to strike out more potential prime numbers. The result is that the following are not prime:
9, 15, 21, 27, 33
Find the next available prime available, which is five. This number is also the highest number whose square is less than 35, so it is the last number to examine. Multiplying five returns 25 and 35 as non-prime numbers.
Review the remaining primes as the Sieve number. These are:
1, 2, 3, 5, 11, 13, 17, 19, 23, 29, 31, 33