This programme finds all the prime numbers in any given range using a variant of a Sieve of Eratosthenes
Instead of checking each number in the range for primality by finding factors (factoring), which would be inefficient, the programme builds a map of all possible products in the given range. Any integer that is not in this list of products is therefore prime.
Click here for a graphical demo of the product mapping
or enter an integer range here: -