I often see how people points out that a certain number is a palindrome in some base, the implication being that it is somewhat a special number. Of course such considerations are rather subjective, but that made me wondering; is it the property of being a palindrome so rare? To be precise:
What is the probability that a given natural number $n$ is a palindrome in at least one base $b\in\{2,3,\ldots,10\}$? What about if we let $b\in\{2,3,\ldots,n-2\}$?
For those who might be bothered for the use of "probability that a given natural number": You can understand that I am asking about the natural density of palindromes, with the above precisions. I just stated the question as it is because I might content myself with some simulation or insight on the subject (the reason being that I haven't found much about this on the web and couldn't come up with an answer myself, so just in case it is harder than expected...), and because of future readers who might also be intrigued about this and don't know about natural density.
Well, if you look at some base $b$ and numbers that can be written in $n$ digits in that base, the number of such numbers is $b^n-b^{n-1}=(b-1)\,b^{n-1}$. Out of these, the number of palindromes is $$ (b-1)\,b^{\frac n2-1}\text{ if $n$ is even, and}\quad (b-1)\,b^{\frac{n+1}2-1}\text{ if $n$ is odd}. $$ (I am assuming you are interested in number that do not start with a "$0$"). This suggests densities relative to base $b$ of $$ \frac{(b-1)\,b^{\frac n2-1}}{(b-1)\,b^{n-1}}=\frac{1}{b^{\frac n2}} \text{ if $n$ is even, and}\quad \frac{(b-1)\,b^{\frac{n+1}2-1}}{(b-1)\,b^{n-1}}=\frac{1}{b^{\frac{n-1}2}} \text{ if $n$ is odd} $$ or: $$ \frac1{b^{\lfloor\frac n2\rfloor}}. $$
Of interest is the fact that these densities $\to0$.
Of course if you want to add up densities for several bases, you then have to worry about palindromes in several bases simultaneously, but the above expressions give you a good starting point / order of magnitude.