Finds the smallest base b such that n can be represented as a palindrome