\section*{Problem 4 - 300934}

Determine all natural numbers \(\mathrm{n}\) between 100 and 400 for which the sum \(s\) of the digits in the decimal representation of \(n\) (the usual "cross sum") is equal to the sum \(t\) of the digits that appear in the representation of \(n\) in base 9.

Hint:

To form a sum of digits, of course, each individual digit must be considered as a number. This is possible without ambiguity, as the digits \(0,1, \ldots\), 8 in the base 9 system represent the same numbers as in the decimal system.
}

Let \(n = z_{2} \cdot 10^{2} + z_{1} \cdot 10 + z_{0}\) be the representation of \(n\) in the decimal system and \(n = n_{2} \cdot 9^{2} + n_{1} \cdot 9 + n_{0}\) the representation in the base 9 system. Since \(9^{3} = 729 > 400 \geq n\), three digits are sufficient. Then \(s = z_{2} + z_{1} + z_{0}\) and \(t = n_{2} + n_{1} + n_{0}\).

Because \(10 \equiv 1 \pmod{9}\), we have \(n \equiv z_{2} \cdot 1^{2} + z_{1} \cdot 1 + z_{0} = s \pmod{9}\), and similarly, because \(9 \equiv 1 \pmod{8}\), we also have \(n \equiv n_{2} \cdot 1^{2} + n_{1} \cdot 1 + n_{0} = t \pmod{8}\).

If \(s = t\), then \(n - s = n - t\) is divisible by both 9 and 8, and since \(\gcd(9, 8) = 1\), it is also divisible by \(9 \cdot 8 = 72\). It follows that \(n - s = n - t \in \{144, 216, 288, 360\}\).

Since \(n \leq 400 < 404 = 5 \cdot 81 - 1\), we have \(n < 488_{9}\). Therefore, \(t < 4 + 8 + 8 = 20\), so \(t \leq 19\).

Case 1: \(n - s = n - t = 144\).

Then \(145 \leq n \leq 144 + 19 = 163\), so \(s \leq 1 + 5 + 9 = 15\) and thus \(145 \leq n \leq 144 + 15 = 159\). Since \(145 = 171_{9}\) and \(159 = 186_{9}\), we have \(9 \leq t \leq 16\). Therefore, \(149 \leq n \leq 159\). For \(n = 149\), \(s = 14\) and since \(n = 1759\), \(t = 13\), so it is not a solution.

For \(n = 150 + z_{0}\), \(s = 6 + z_{0}\). If \(0 \leq z_{0} \leq 2\), then \(176_{9} \leq n \leq 178_{9}\), so \(s \leq 8\) and \(t \geq 14\), which means no solution. For \(3 \leq z_{0} \leq 9\), \(n = 1 \cdot 9^{2} + 8 \cdot 9 + (z_{0} - 3)\), so \(t = 1 + 8 + (z_{0} - 3) = 6 + z_{0} = s\).

Thus, all \(n \in \{153, 154, 155, 156, 157, 158, 159\}\) are solutions.

Case 2: \(n - s = n - t = 216\).

Then \(217 \leq n \leq 216 + 19 = 235\) and thus \(s \leq 2 + 2 + 9 = 13\), so \(n \leq 216 + 13 = 229\). Since \(217 = 261_{9}\) and \(229 = 274_{9}\), we have \(9 \leq t\), so \(225 \leq n \leq 229\).

For \(n = 220 + z_{0}\) with \(z_{0} \geq 5\), \(n = 2 \cdot 9^{2} + 7 \cdot 9 + (z_{0} - 5)\), so \(s = 2 + 2 + z_{0} = 4 + z_{0}\) and \(t = 2 + 7 + (z_{0} - 5) = z_{0} + 4 = s\), so all values \(n \in \{225, 226, 227, 228, 229\}\) are solutions.

Case 3: \(n - s = n - t = 288\).

Then \(289 \leq n \leq 288 + 19 = 307\). Since \(289 = 351_{9}\) and \(307 = 371_{9}\), we have \(9 \leq t \leq 17\). Therefore, \(297 \leq n \leq 305\). If \(300 \leq n \leq 300\), then \(s \leq 3 + 0 + 5 = 8\), which is not possible since \(t \geq 9\).

Thus, \(297 \leq n \leq 299\) and \(s \geq 18\), while \(297 = 360_{9}\) and \(299 = 362_{9}\), so \(t \leq 3 + 6 + 2 = 11\), which means no solution exists here.

Case 4: \(n - s = n - t = 360\).

Then \(361 \leq n \leq 379\). Since \(s \geq 10\), we have \(370 \leq n \leq 379\), so \(n = 370 + z_{0}\) and \(s = 10 + z_{0}\). Since \(370 = 451_{9}\), for \(0 \leq z_{0} \leq 7\), \(n = 4 \cdot 9^{2} + 5 \cdot 9 + (z_{0} + 1)\) and \(t = 4 + 5 + z_{0} + 1 = 10 + z_{0} = s\), so all \(n \in \{370, 371, 372, 373, 374, 375, 376, 377\}\) are solutions.

If \(n = 370 + z_{0}\) with \(8 \leq z_{0} \leq 9\), then \(s = 10 + z_{0}\), and \(n = 4 \cdot 9^{2} + 6 \cdot 9 + (z_{0} - 8)\), so \(t = 4 + 6 + z_{0} - 8 = 2 + z_{0} \neq s\), which means no further solutions exist.

In summary, the following \(n\) satisfy the condition of the problem:

\(n \in \{153, 154, 155, 156, 157, 158, 159, 225, 226, 227, 228, 229, 370, 371, 372, 373, 374, 375, 376, 377\}\)