What are all possible numbers gotten by an digit-exchange operation?

89 Views Asked by At

A friend of mine taught me a number game.

Supposting that $a_na_{n-1}\cdots a_1$, which satisfies $a_n\gt a_1$, is a natural $n$-digit number with decimal representation, let's consider the following operations :

1. $a_na_{n-1}\cdots a_1-a_1a_2\cdots a_n=b_nb_{n-1}\cdots b_1.$

2. $b_nb_{n-1}\cdots b_1+b_1b_2\cdots b_n.$

Let $N(a_na_{n-1}\cdots a_1)$ be the number gotten by these operations.

Remark : Suppose that $0$ is added in the case of cancellation of significant digits by the step 1.

Examples :

$4312-2134=2178\rightarrow 2178+8712=10890$. Hence, we get $N(4312)=10890.$

$514-415=099\rightarrow 099+990=1089$. Hence, we get $N(514)=1089.$

Then, here is my question.

Question : Find all possible $N(a_na_{n-1}\cdots a_1)$ for each $n\ge 4$.

Motivation : A friend of mine taught me that it is known that only $99$ can be gotten for $n=2$ and that only $1089$ can be gotten for $n=3$. These got me interested in the above question. My search tells me that only $10890, 10989, 9999$ seems to be gotten for $n=4$. Thought I've looked for a way to solve without using computer, I'm facing difficulty. Can anyone help?