A palindrome is a number or word that is the same when read forward and backward, for example, “176671” and “civic.” Can the number obtained by writing the numbers from 1 to n in order (n > 1) be a palindrome?
|
|
No. With $n=1$, we do have a palindrome of course. But for $n>1$ we can clearly exclude the case $n\le 10$. In fact, we need $n\equiv 1\pmod {10}$, as the palindromic string ms must end in "$\ldots 1$". Let $k\ge1$ with $10^k<n<10^{k+1}$. Then there is exactly one position in the assumed palindromic string "$12345\ldots54321$" where "$1\underbrace{0\ldots0}_k1$" occurs: In the absence of leading zeroes, only the two $1$s in this block can be leading digits of some numbers, and since no number has more than $k+1$ digits, indeed both $1$s must be leading digits, i.e. the only position where this pattern occurs is at the number $10^k$ (together with the leading $1$ of $10^k+1$). For a palindrome, such a uniquely occuring subpalindrome must be in the very middle. But it is preceeded by "$\underbrace{9\ldots9}_k$" from $10^k-1$ and followed by "$\underbrace{0\ldots0}_{k-1}1$" as the rest of $10^k+1$, contradicting the palindromic symmetry. |
||||
|
|
|
Here's a beginning of the task where the numbers do not have to be in order. Note that a palindrome can have at most one digit which occurs an odd number of times - the centre digit if the number of digits is odd. Now after 1, you have to have all digits 1-9 - nine digits. If you stop below 100 you will always have an odd number of digits (1-9 plus pairs from the two digit numbers). So you can work on digit parities to reduce the number of cases you have to consider. |
|||
|
|
|
The answer is no - there's a variety of ways to prove this. For example, consider the number $k$ in the list with the most 0's, say $m$ of them. Clearly, $k$ must consist of a single digit followed by $m$ 0's, otherwise there would be a number before it with more 0's. Now we have two cases:
Therefore, it's impossible for the concatenation of the $n$ integers $1$ through $n$ to be a palindrome. |
|||
|
|
