Sunday, 20 July 2014

mathematics - Can consecutive numbers form a palindrome?


Consider a number formed by concatenating all the natural numbers from $1$ to $n$, for some $n>1$.


(E.g. with $n=13$ this number would be $12345678910111213$.)



Is it possible for such a number to be a palindrome?


Please provide either an example or a proof of impossibility.


I found this puzzle in the 1996 All-Russian Mathematical Olympiad.



Answer



(I'm sure I saw almost exactly this question somewhere in the last week or thereabouts. Maybe my brain's playing tricks. I don't think I read the 1996 All-Russian Mathematical Olympiad recently. Perhaps there was another question about concatenated consecutive numbers.)


The answer is that



it is not possible.



Why?




Suppose $n$ has $k$ digits. By inspection $k>1$. Let $m$ consist of the last $k-1$ digits of $n$; then the end of our monstrous number looks like $k-1$ 9s, then the first digit of $n$, then $k-1$ 0s, then another $km$ digits. Therefore its start looks like the reverse of that: $km$ digits, then $k-1$ 0s, then the first digit of $n$, then $k-1$ 9s.



But



this can't happen. That string of $k-1$ zeros after the first $km$ digits can't include the first digit of any of the constituent numbers making up the monstrous number, so they are in fact the final $k-1$ digits of a $k$-digit number. But then they cannot possibly be followed by a single digit and then $k-1$ 9s; rather, they must be followed by a single digit, $k-2$ 0s, and a single 1. Contradiction.



No comments:

Post a Comment