function to determine if input is a prime number