For each positive integer $n$ let $s(n)$ denote the sum of the decimal digits of $n$. Find all pairs of positive integers $(a, b)$ with $a > b$ which simultaneously satisfy the following two conditions $$a \mid b + s(a)$$$$b \mid a + s(b)$$ Proposed by Victor DomÃnguez
Problem
Source: Mexico National Olympiad Mock Exam 2018 Problem 4
Tags: number theory, sum of digits, Divisibility
RagvaloD
06.11.2018 18:50
$s(a) \leq a$ so $b+s(a)<2a \to a=b+s(a)$ So $a$ has $2$ or more digits. If $a$ has more than $2$ digits then easy to prove, that $a>10s(a)$ so $9a<10b$ So $a+s(b) \geq 2b \to 8b<9s(b) \to$ true only for one digit $b$ $\to 9a<90 \to $contraditiction. So $a$ is $2$-digit number. $a=10x+y, b= 9x$ $s(b)=s(9x)=9$ $9x|10x+y+9 \to 9x|x+y+9$ $x+y+9\leq 19x \to x+y+9=9x$ or $x+y+9=18x$ Case 1:$x+y+9=9x$ $y+9=8x \to x=2,y=7 \to (a,b)=(27,18)$ Case2 : $x+y+9=18x$ $y+9=17x \to x=1,y=8 \to (a,b)=(18,9)$
plagueis
07.11.2018 05:54
Let us observe first that $s(n) \leq n$ for each $n$. This is clear, because if $n = \overline{n_kn_{k - 1}\dots n_0}$ is the decimal representation of $n$ then
$$n = 10^kn_k + 10^{k - 1}n_{k - 1} + \dots + 10n_1 + n_0 \geq n_k + n_{k - 1} + \dots + n_1 + n_0 = s(n)$$
Then we have $b + s(a) \leq b + a < 2a$, as $b < a$. Since $0 < b + s(a) < 2a$ and $a$ divides $b + s(a)$, we infer that $a = b + s(a)$. Substituting in the second condition we have
$$b \mid b + s(a) + s(b) \implies b \mid s(a) + s(b)$$
We have $b = a - s(a)$. We claim that if $n$ has $k + 1$ digits, then $n - s(n) \geq 10^k - 1$, with equality if and only if $n = \overline{100\dots 0d}$ for some digit $d$. This follows from
$$n - s(n) = (10^k - 1)n_k + (10^{k - 1} - 1)n_{k - 1} + \dots + (10^0 - 1)n_0 \geq 10^k - 1 + (n_{k - 1} + \dots + n_1)$$
Let us assume now that $a$ has $k + 1$ digits. From the claim, $b \geq 10^k - 1$. Moreover, since $b < a$, both $a$ and $b$ have at most $k + 1$ digits, and $s(a), s(b) \leq 9(k + 1)$. Since $b$ divides $s(a) + s(b)$ we get that
$$10^k - 1 \leq 18(k + 1)$$
And it is easy to see that this inequality is not true for $k \geq 2$. If $k = 0$ then $a$ has exactly one digit, so $a = s(a)$, and thus $b = 0$, but this is not possible. So we get $k = 1$, and $a$ has exactly two digits.
We denote now $a = \overline{cd}$, then $a = 10c + d$ and $b = a - s(a) = 10c + d - c - d = 9c$, so that $b$ is multiple of $9$. Let us see now that $s(a), s(b) \leq 18$, from which we infer $b \leq s(a) + s(b) \leq 36$. This in turn gives $b < 99$ and $s(b) \neq 18$, and since $9 \mid b$ we have $s(b) = 9$. Substituting now in $b \leq s(a) + s(b)$ we have
$$9c \leq c + d + 9 \implies 8c \leq d + 9$$
This is not possible if $c \geq 3$. Finally, since $9 \mid 9c$ and $9c \mid c + d + 9$ we have that $9 \mid c + d$, and thus the cases $c = 2$ and $c = 1$ give $a = 27$ and $a = 18$. These give us the only solutions, which are the pairs $(18, 9)$ and $(27, 18)$.