Added powmod and is_prime as suggested by Peter Luschny.