[Math] Distribution of palindromic numbers

number theorypalindromerecreational-mathematics

We all know what a palindromic number is, it is a number which is the same, independent from which side we read it, for example $101, 202, 33733, \dots$

It is also clear that there are infinity many palindromic numbers. What I am interested in is the frequency of palindromic numbers in specific intervals.

For exmaple: In the interval $[100,999]$ there exist 9 palindromic numbers.
In $[1000,9999]$ we have 90, in $[10000,99999]$ we have 252, in $[100000-999999]$ we have 333. I calculated them by hand, is it somehow possible to use mathematica for that?

How does this look like for really high intervals, how does the numbers of palindormic change, what is the relation bewteen the interval and the numbers of palindromic numbers?

What I also asked myself, taking a random palindromic number $a\in[1000,9999]$ for example, how can we reverse the reverse-and-add algorithm. I mean the following: Taking a random number, for exmaple $15$. Then I reverse it and add it to the number itself: $15+51=66$, then we get a palindromic. How can it be evaluated on how many ways the number $66$ can be reiceived? In this case it is obviously one, but how do we know how many different numbers lead for exmaple to the number $5556555$ ?

Best Answer

In the interval $[100,999]$ there are $90$ palindromes. You can choose the first digit $9$ ways and the middle digit $10$ ways. Generally, for $n$ digit numbers there are $$\begin {cases} 9\cdot 10^{\frac {n-2}2} & n \text { even} \\ 9\cdot 10^{\frac {n-1}2} & n \text { odd} \end {cases}$$ palindromes. Again, you can choose the first digit $9$ ways and the rest of the first half of the number (rounded up for odd numbers of digits) $10$ ways .

To get $66$ with reverse and add, you can have $15,24,33,42,51$ as starting numbers. For $5556555$ you can certainly have four choices $(1-4)$ for the first digit, six $(0-5)$for the next two, and one choice $(3)$for the middle digit. Then the lower three digits are determined by the top three. This gives $144$ numbers. There might be more, as I have avoided carrying.

Related Question