Problem

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?

Solution

No. For $n>1$ we can clearly exclude the case $n≤10$. In fact, we need $n \equiv 1 \mod 10$ as the palindromic string must end in “$\dots 1$”. Let $k≥1$ with $10^k<n<10^k+1$. Then there is exactly one position in the assumed palindromic string $12345…54321$ where $10\dots01$ occurs ($k$ zeroes). 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 $9…9$($k$ times) from $10^k−1$ and followed by $0…01$ ($k-1$ zeroes) as the rest of $10^k+1$, contradicting the palindromic symmetry.

This solution was taken from a [Stack Exchange answer](https://math.stackexchange.com/questions/266124/palindrome-of-numbers-from-1-n#:~:text=Therefore%2C it's impossible for the,n to be a palindrome.&text=Here's a beginning of the,number of digits is odd.) by Hagen von Eitzen.

Thank you!

Thank you to Conrad Warren (Edmonton, Canada) and Ravi Dayabhai (California, USA) for submitting an answer to this week’s challenge problem!