Maths Olympiad Prep

Track / Stage 6 / 40 of 400 #1680 of 2604

Problem 1680

National Olympiad, first round
Number theory Difficulty 6.0 Prove it IRL ABooklet · Ireland

For any positive integer NN we denote by {‾N}\overline\{N\} the number obtained by writing the digits of NN from right to left. For instance, if N=2395N = 2395 then {‾N}=5932\overline\{N\} = 5932 and if N=3780N = 3780 then {‾N}=873\overline\{N\} = 873.
Find all positive integers NN such that N−{‾N}=9N - \overline\{N\} = 9.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

If NN has one digit this is not possible. If NN has two digits, say N=abN = ab, then {‾N}=ba\overline\{N\} = ba so that N−{‾N}=9(a−b)N - \overline\{N\} = 9(a - b) which yields a−b=1a - b = 1 so the numbers are
N=10,21,32,43,54,65,76,87,98. N = 10, 21, 32, 43, 54, 65, 76, 87, 98.
Assume there are numbers NN with the above property that have m≥3m \ge 3 digits. Thus, we may write
N=aZb N = aZb
where a∈{1,2,3,…,9}a \in \{1, 2, 3, \dots, 9\} and b∈{0,1,2,3,…,9}b \in \{0, 1, 2, 3, \dots, 9\} are digits and ZZ is a positive integer with m−2≥1m - 2 \ge 1 digits. We may need to include leading zeros in the presentation of ZZ. Then, {‾N}=b{‾Z}a\overline\{N\} = b\overline\{Z\}a, where {‾Z}\overline\{Z\} is obtained by writing the digits of ZZ from right to left. We now have
9=N−{‾N}=(10m−1a+10Z+b)−(10m−1b+10{‾Z}+a) 9 = N - \overline\{N\} = (10^{m-1}a + 10Z + b) - (10^{m-1}b + 10\overline\{Z\} + a)
which yields
9=(10m−1−1)(a−b)+10(Z−{‾Z}).(6) 9 = (10^{m-1} - 1)(a - b) + 10(Z - \overline\{Z\}). \quad (6)
Because N≥{‾N}N \ge \overline\{N\}, we must have a≥ba \ge b.
If a−b=0a - b = 0 then (6) cannot hold because the right-hand side is a multiple of 10 while the left-hand side is not. If a−b≥2a - b \ge 2 we again raise a contradiction since N≥a⋅10m−1N \ge a \cdot 10^{m-1} and {‾N}≤(b+1)⋅10m−1\overline\{N\} \le (b + 1) \cdot 10^{m-1} imply
9=N−{‾N}≥(a−b−1)⋅10m−1≥10m−1≥100. 9 = N - \overline\{N\} \ge (a - b - 1) \cdot 10^{m-1} \ge 10^{m-1} \ge 100.
Hence a−b=1a - b = 1 and from (6) we find 9=10m−1−1+10(Z−{‾Z})9 = 10^{m-1} - 1 + 10(Z - \overline\{Z\}) from which we get
{‾Z}−Z=10m−2−1.(7) \overline\{Z\} - Z = 10^{m-2} - 1. \quad (7)
Clearly, Z=0Z = 0 does not satisfy (7). If Z>0Z > 0, (7) implies {‾Z}>10m−2−1\overline\{Z\} > 10^{m-2} - 1. Recall now that ZZ and {‾Z}\overline\{Z\} have at most m−2m - 2 digits, fewer than m−2m - 2 if ZZ contains leading digits equal to zero. Hence, ZZ and {‾Z}\overline\{Z\} cannot exceed 10m−2−1=999…910^{m-2} - 1 = 999\dots9, the number that consists of m−2m - 2 digits 9. This contradiction shows that when m≥3m \ge 3 there is no solution.
Hence, the only numbers satisfying the condition in the problem are the two-digit numbers listed above.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.