Checks if a number is a palindrome