Determines if a number is a prime