## Task 15/71

The natural numbers $a$ and $b$ are represented in a number system with base $n$. Here, $b$ is derived from $a$ by removing the first digit of $a$ and appending it at the end.

Determine $n$ and the smallest possible numbers $a$ and $b$ from the fact that $a-b=1211$ (where $1211$ is also represented in the system with base $n$).
Lemma: A natural number \( x \) represented in a base \( n > 2 \) system leaves the same remainder when divided by \( n-1 \) as its digit sum.

Proof of the lemma:

Let

\[
x = \sum_{k=0}^{m} a_{k} n^{k}
\]

Since \( n^{k} \) leaves a remainder of 1 when divided by \( n-1 \), \( a_{k} n^{k} \) leaves a remainder of 0 (if \( a_{k} = n-1 \)) or the remainder \( a_{k} \) when divided by \( n-1 \). The sum of the remainders of all terms differs from the remainder of the sum of all terms by at most a multiple of \( n-1 \). Thus, the claim follows immediately.

From the lemma, it further follows that in any system with base \( n > 2 \), the difference between two numbers consisting of the same digits is always divisible by \( n-1 \). This theorem applies to the difference in our problem.

Since 1211 has a digit sum of 5 and 5, being a prime number, is only divisible by 5 and 1, only \( n_{1}-1=1 \) and \( n_{2}-1=5 \) with \( n_{1}=2 \) and \( n_{2}=6 \) are possible. The base \( n_{1}=2 \) is ruled out because the digit 2 does not occur in the binary system. Therefore, \( n=n_{2}=6 \).

Now, \( a = 1211 + b \). The number \( a \) must be at least four digits long; its first digit can be 1, 2, 3, 4, or 5. Assuming it is 1, then the last digit of \( b \) is also 1, and the last digit of \( a \) (second to last of \( b \)) is 2. Continuing this process leads to a five-digit number \( a \), which may not be the smallest number \( a \).

Assuming the first digit of \( a \) is 2, we get \( a = 2043 \) and \( b = 0432 \).