Function for check if a number is prime