optimized is_a_prime function in prime.py