Sieve of Eratosthenes is a simple and ancient algorithm (over 2200 years old) used to find the prime numbers up to any given limit. It is one of the most efficient ways to find small prime numbers. Implementations in C, C++, C Sharp, Java, Go, Haskell, JavaScript, PHP and Python.