Is $404$ a palindrome in base negative $31$

elementary-number-theorypalindromerecreational-mathematics

I was browsing on a website and I accidentally clicked on a link (Here is the link, but it may not show the same thing). The following was written there:

$404$ is also a palindrome in base negative $31$.

Firstly, I have always known that number bases are always positive. So, how is a negative number base defined? And is it really true that $404$ is also a palindrome in base $-31$? This also arises the following question in my mind:

Can any number (palindrome or non-palindrome) be written as a palindrome in some base?

I found that a number $n$ is equal to $11$ in base $(n-1)$, which is a two-digit palindrome. So, this seems to be true (please correct me if I am wrong). So, let's modify the above question for negative numbers that is "can any number (palindrome or non-palindrome) be written as a palindrome in some negative base"?

Best Answer

For a positive base $k$, we can write any number $x$ out in the form $\sum_{i=-m}^na_ik^i$ for some positive integers $m,n$ and $0\le a_i<k$, allowing $m=\infty$ if necessary. For instance, with $k=10,x=13.214$, we have $m=3,n=2,a_{-2}=4,a_{-1}=1,a_0=2,a_1=3,a_2=1$. The case $m=\infty$ occurs if you have a non-terminating decimal expansion (e.g. $k=10,x=1/3,n=0,m=\infty,a_i=1$ for $i<0$).

This generalises to negative $k$ too: no part of the definition needs to be changed. (But we will have to start asking questions about whether every real number can be written uniquely in base $k$.) For $k=-31$, the last digit before the (no-longer-)decimal place is still a unit, but the digit before has value $-31$, and the next one $(-31)^2$ and so on. For instance, the base $-31$ value $345.6$ means $3\times (-31)^2+4\times -31+5\times 31^0 + 6\times 31^{-1}$.

Observe that $404=(-31)^2+18\times-31+1$, so it has digits (from right to left) $1$, $18$ and $1$. (To write this as a single number we might use $a=10,b=11,\dots,z=35$ to get $404_{10}=1i1_{-31}$.) This is a palindrome.

Your last question, "Can any number (palindrome or non-palindrome) be written as a palindrome in some base?", has an even more trivial answer than the one you give: a number $x$ is a single digit in base $x+1$, so yes. As for the negative base, there are again lots of trivial answers: try base $-(x+1)$ and we will again have a single digit number.