Method that takes a number and returns true if it is prime and false otherwise.