(slightly) faster primality testing