We denote by $S(k)$ the sum of digits of a positive integer number $k$. We say that the positive integer $a$ is $n$-good, if there is a sequence of positive integers $a_0$, $a_1, \dots , a_n$, so that $a_n = a$ and $a_{i + 1} = a_i -S (a_i)$ for all $i = 0, 1,. . . , n-1$. Is it true that for any positive integer $n$ there exists a positive integer $b$, which is $n$-good, but not $(n + 1)$-good? A. Antropov
Problem
Source: All Russian MO 2015, grade 10, problem 4
Tags: number theory, Sequence
25.09.2015 01:57
Take another look to this nice problem!
25.09.2015 03:33
The answer is yes. Set $F(x)=x-S(x)$. Note that $F(x)$ is always divisible by 9. 1. First, we claim that if $|F(x)-F(y)|=9k$ then $x$ and $y$ agree in all but the last $k+1$ digits. Indeed, if $x=\sum c_i10^i, y=\sum \widetilde c_i 10^i$ then $$F(x)-F(y)=\sum (c_i-\widetilde c_i)(10^i-1)$$ Now assume $i$ is the largest index where $c_i\neq \widetilde{c}_i$. Say $c_i>\widetilde c_i$ then $F(x)-F(y)\geq (10^i-1)-9(10^{i-1}-1)-9(10^{i-2}-1)-\ldots=9i$. It follows that $i\leq k$ as desired. 2. Let $F^{(n)}$ be the $n$-th iterate of $n$. Define also $a_0=1, a_{i+1}=10^{a_i}$. We claim, by induction on $n$, that if $F^{(n)}(x)=F^{(n)}(y)$ then $x,y$ coincide in all but the last $a_n$ digits. Base: if $n=1$ then we apply the previous part with $k=0$. For the induction step, applying the induction hypothesis to $F^{(n-1)}(F(x))=F^{(n-1)}(F(y))$ we conclude that $F(x), F(y)$ coincide in all but the last $a_{n-1}$ digits and thus $|F(x)-F(y)|<10^{a_{n-1}}$. Now apply part 1. 3. Observe that if $x$ is between $10^m-9m$ and $10^m-1$ then the equation $F(y)=x$ has no solution. Indeed, if $y\geq 10^m$ then $F(y)\geq 10^m-1$ and if $y\leq 10^m-1$ then $F(y)\leq 9(10^{m-1}-1)+\ldots=10^m-9m-1$. 4. Pick $N>a_{n+1}=10^{a_n}$ and let $x=10^N-5N$. We claim that $b=F^{(n)}(x)$ is what we need. We just need to show that $b$ does not have the form $F^{(n+1)}(y)$. Indeed, if $b=F^{(n+1)}(y)=F^{(n)}(x)$ then applying part (2) to the equality $F^{(n)}(x)=F^{(n)}(F(y))$ we conclude that $x$ and $F(y)$ coincide in all but the last $a_n$ digits so $|x-F(y)|<10^{a_n}<N$. Thus $F(y)$ is between $10^N-4N$ and $10^N-6N$. But such a number cannot have form $F(y)$ by (3). Contradiction.
07.09.2021 16:43
Let $a_m=10^m-1$. Claim 1. Suppose $a<10^k<b$ and $b-s(b)=a$ then $a=a_k$. Proof. Suppose $b=10^k+c$. Then $s(b)=1+s(c)\leq 1+c$. Henc $b-s(b)\geq 10^k-1=a_k$. Now define $f(a)=a-s(a)$ and $g(a)$ to be the maximal $n$ such that $a$ is $n$-good. We say that an integer $a$ is excellent if there exists $p,q\in\mathbb N$ such that $$f^p(a_q)=a$$Claim 2. For each $n$, there exists a sequence $x_1,....,x_r$ with length $r\geq n$, $$x_i=f(x_{i-1})$$and all of $x_1,...,x_r$ are not excellent. Proof. Suppose on the contrary that every such sequence $x_1,...,x_r$ satisfies $r<n$. Notice that $$\lim_{m\to\infty}\frac{\log s(a_m)}{\log a_m}=\lim_{m\to\infty}\frac{\log 9m}{\log(10^m-1)}=0\hspace{20pt}(1)$$Suppose $b_0=a_m$, where $m$ is even and $b_i=f(b_{i-1})$. Let $c_0=\lfloor \frac{b_0+b_1}{2}\rfloor$ and $c_i=f(c_{i-1})$. Let $k$ be the smallest integer such that $c_n=b_k$ for some $k\in\mathbb N$, then we must have $k\leq n$. Define $d_i=c_i-b_i$ and $e_i=c_i-b_{i+1}$, then we have $$|d_0|,|e_0|\geq s(a_m)-1$$Moreover, let $p=\lceil \log ns(a_m)\rceil$, then $\frac{p}{m}\to 0$ as $m$ to $\infty$. We can see that the leftmost $(m-p-2)$ digit of $b_1,b_2,...,b_n,c_1,...,c_n$ be $9$. Therefore, for each $1\leq i,j\leq n$ we must have $s(b_i)-s(c_j)<9(p+2)$ $$|d_i-d_{i+1}|=|f(c_{i-1})-f(b_{i-1})-c{i-1}+b_{i-1}|=|s(b_{i-1})-s(c_{i-1})|<9(p+2)$$Similarly $$|e_i-e{i+1}|<9(p+2)$$Therefore, $$k\geq \frac{\min\{|d_0|,|e_0|\}}{\max\{|d_i-d_{i+1}|,|e_i-e_{i+1}|\}}>\frac{9m-1}{9(p+2)}\to \infty$$as $m\to\infty$, which is a contradiction since $k\leq n$. $\blacksquare$ From Claim 1 it is easy to see that the $i^{th}$ term in the sequence in Claim 2 is $i$-good but not $(i+1)$-good so we are done.
31.12.2024 23:40
Let $f(n) = n - S(n)$ for each $n$. We only consider $f$ on multiples of $9$ for obvious reasons. The key claim is the following: Claim: Suppose that two positive integers $m$ and $n$ differ in at least their last $k$ place values. Then $|f(n) - f(m)| \geq 9(k-1)$. Proof: Let $m = \overline{a_ra_{r-1}\cdots a_0}$ and $n = \overline{b_rb_{r-1} \cdots b_0}$, where we permit leading zeroes. It follows that \begin{align*} |f(n)-f(m)| &= \left|\sum_{i=0}^r (10^i-1)(a_i-b_i)\right| \\ &\geq \left(10^{k-1} - 1\right) - 9 \sum_{i=0}^{k-2} \left(10^i - 1\right) \\ &= 9(k-1). \end{align*}This proves the claim. $\blacksquare$ Now, we call a positive integer $n$ cooked if there is no $m$ such that $f(m) = n$. Claim: For sufficiently large $N$, for every $k < N$ the number $10^N - 1 - 9k$ is cooked. Proof: Assume for the sake of contradiction that there existed an $m$ with $m - S(m) = 10^N - 1 - 9k$. If $m \leq 10^N$, then $m$ itself is of the form $10^N - 1- 9\ell$, and it follows that $S(m) = 9(k-\ell)$; thus \[S\left(10^N - 1 - 9\ell\right) < 9(N-\ell).\]This can be rearranged to \[S\left(10^N - 1\right) - S\left(10^N - 1 - 9\ell\right) > 9\ell.\]But for every digit $d_i \neq 9$ in $m$, the RHS difference is given by $\sum (9-d_i) 10^i$ while the LHS difference is given by $\sum (9-d_i)$, so this is obviously impossible. If $m > 10^N$, then for $m = 10^N - 1 + 9\ell$ we need $S(m) = 9(k+\ell) \geq 9(1+\ell)$. This is impossible using a similar argument, this time comparing to $S\left(10^N\right)$. $\blacksquare$ Now fix a positive integer $n$. We call the chain at $m = 10^N - 1 - 6N$, with $N$ to be determined, the sequence $m, f(m), f^2(m), \dots$. Relabel this sequence as $a_0 = m, a_1, a_2, \dots$. I claim that we can pick $N$ such that $a_n$ is $n$-good but not $n+1$-good; clearly $a_n$ must be $n$-good. Now assume for the sake of contradiction that $a_n$ is $n+1$-good, say via some sequence $b_0, b_1, \dots, b_{n+1} = a_n$. Then because $|f(b_n) - f(a_{n-1})| = 0$, the converse of the claim implies that $b_n$ and $a_{n-1}$ differ in at most their last digit, so $|b_n - a_{n-1}| \leq 9$. In general, I claim: Claim: There exists a function $g(i)$ such that $|b_{n-i+1} - a_{n-i}| \leq g(i)$ for each $1 \leq i \leq n$. Proof: By induction. The base case is vacuous; for the inductive step, $|f(b_{n-i+1}) - f(a_{n-i})| \leq g(i)$, so $b_{n-i+1}$ and $a_{n-i}$ differ in at most their last $g(i)$ digits. Thus their difference is at most $10^{g(i) + 1}$, which we can assign to $g(i+1)$, as needed. $\blacksquare$ But now it follows that $|b_1 - m| \leq g(n)$. As $g(n)$ depends only on $n$, picking $N > g(n)$ yields that $b_1$ is between $10^N - 1 - 7N$ and $10^N - 1 - 5N$. Thus $b_1$ is cooked, so such a $b_0$ cannot exist, contradiction! Remark: This problem contains some of the hardest analysis I've ever doneāthe first claim is absolutely critical to the problem, as it gives us a size bound on two chains that eventually converge to the same number that feeds itself. However, it's really hard to see (and impossible to state reasonably without the words ``place value").