Checks if a given number n is palindromic and returns the lowest base for which n is a palindrome