Add is_prime function to test primality.

Fixed a bug with the Sieve of Eratosthenes.