check primality