test a number for primality