Test if a number is prime