implementing sieve of eratosthenes (inputs from http://primes.utm.edu/glossary/page.php?sort=SieveOfEratosthenes)