1.

Find all prime numbers between 1 to 100 using sieve of Eratosthenes

Answer»

Prime numbers between 1 and 100 with the Sieve of Eratosthenes:

We start by placing the numbers from 1 to 100 in a table like this. This way it’s very easy to see the patterns that the multiples of each number make. We highlight the 1, which is not a prime number.

First, we look for the multiples of 2 and highlight them (leaving the 2, since we know it only has divisors of 1 and 2, and is therefore prime). All the highlighted numbers will be composite.

Now, from the numbers that are left, we look for the multiples of 3 and highlight them (except for 3, since it’s prime). An easy way to do it is by counting in threes. We get another interesting pattern when we’re done.

Now it’s time to look for the multiples of 5. We don’t need to look for the multiples of 4, because all the multiples of 4 are also multiples of 2, so we’ve already highlighted them. It’s easy to find the multiples of 5, they all end in either 0 or 5. We don’t highlight the 5, because it’s prime.

Let’s move on to the multiples of 7 (6 = 2 x 3 and we’ve already found the multiples of 2 and 3). We don’t highlight the 7, since it’s prime.

Do we have to look for the multiples of 8, 9 and 10? Since these numbers are composite and multiples of numbers that we’ve already looked for, we can move on to the number 11. We’ve already established that we stop at the number 11, so that means we’ve finished!

List of prime numbers between 1 and 100We can therefore determine that the numbers that we haven’t highlighted are all prime numbers. So now we have the list of prime numbers between 1 and 100:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97.



Discussion

No Comment Found