Determines if a number is prime