4
$\begingroup$

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.

  • 0
    Well for the second question usin base $b-1$ the number is then 11 which is always a palindrome2017-02-04
  • 0
    @kingW3 Oh, I guess you mean base $n-1$. I didn't notice that trivial case, sorry I am editing..2017-02-04
  • 1
    After some research, the density of second numbers is 100% or the converse the density of numbers not written in that way is smaller then the density of primes which is 0. https://en.m.wikipedia.org/wiki/Strictly_non-palindromic_number2017-02-04
  • 0
    @kingW3 Thank you for the link!! You might want to post an answer as that does answer the second question...2017-02-04

3 Answers 3

2

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.

  • 0
    I am using $n$ for a given natural number; the question was not about density of palindromes with $n$ digits. Your answer does provide a density of numbers which are palindromes in one base $b$, but not in the range $b\in\{2,...,10\}$ since there will ve overlaping between them.2017-02-04
  • 0
    @mathbeing That is correct.2017-02-04
  • 0
    Filling in some minor details (see my answer) your answer and kingW3's gave me a solution to both questions. I feel it would be unfair to accept one answer since each of them provided half the solution so I am just upvoting the both of you. Thank you!! :)2017-02-04
1

The density of numbers that aren't palindrome for some $b\in\{2,3,\cdots,n-2\}$ is smaller then the density of prime numbers which is $0$.That's because every such number must be a prime.

For the first by the formula A.G. provided if you sum the probabilities for $2,3,4,5,6,7,8,9,10$ you'll still get $0$ and that's if you overcount the palindromes that are also in other bases.

  • 0
    Using the formula A.G. provided one can calculate that the density of palindromes in any base $b$ is zero, so the density of palindromes in base $b\in\{2,\ldots,10\}$ must also be zero. Yes, but one has to calculate it and notice that A.G. is using $n$ as the number of digits, so your second paragraph is either misleading or wrong.2017-02-04
  • 0
    It's probably misleading,but you can compare the sum to the geometric sum http://www.wolframalpha.com/input/?i=sum+10%5E(n%2F2) so the sum is asymptotically almost $\frac{1}{b^{n/2}}$ which still converges to $0$ and a sum of finite things who converge to $0$ is still zero.2017-02-04
  • 0
    Yes, see my answer! On a different note; I feel it would be unfair to accept your answer or A.G.'s since each of them provided half the solution so I am just upvoting the both of you. Thank you!! :)2017-02-04
0

[I am just connecting the dots from the two answers I got to my two questions. Merits for the answer to the first question to @A.G., and for the second one to @kingW3.]

Case $b\in\{2,\ldots,10\}$: The answer is that the natural density is $0$; that is, imprecisely, that the probability of randomly picking a natural number which is a palindrome in at least one base $b\in\{2,\ldots,10\}$ is $0$.

Let's fix $b$. For $N\in\mathbb{N}$ let $j=j(N)\in\mathbb{N}$ be given by $b^j\leq N

Case $b\in\{2,\ldots,n-2\}$: From kingW3's comments, the numbers $n$ which are non-palindromic in any base $b\in\{2,\ldots,n+2\}$ are called strictly non-palindromic. These numbers are all primes except for $0,1,4$ and $6$, which, since the natural density of the prime numbers is $0$, tells us that the natural density of the numbers $n$ which are palindromes in at least one base $b\in\{2,\ldots,n-2\}$ is $1$.