Fix is_prime shortcut test for divisibility by 2 and 5