Number version Valid Palindrome

unlike string, we can't use an pointer to access the ith of a number.

mathematical method to extract ith of the number x

function ith(x, i)
   return (x / Math.pow(10, i)) % 10