Test for is_prime, implementation