For any integer
![n\geq 2](/media/m/e/d/b/edbb3c15913fef4235c90cca2333a608.png)
, we compute the integer
![h(n)](/media/m/2/6/7/267032991ac22212e488868b1dde2d7c.png)
by applying the following procedure to its decimal representation. Let
![r](/media/m/3/d/f/3df7cc5bbfb7b3948b16db0d40571068.png)
be the rightmost digit of
![n](/media/m/a/e/5/ae594d7d1e46f4b979494cf8a815232b.png)
.
If
![r=0](/media/m/c/7/0/c701c4948b65d242d40d5fc331ffc8ce.png)
, then the decimal representation of
![h(n)](/media/m/2/6/7/267032991ac22212e488868b1dde2d7c.png)
results from the decimal representation of
![n](/media/m/a/e/5/ae594d7d1e46f4b979494cf8a815232b.png)
by removing this rightmost digit
![0](/media/m/7/b/8/7b8b0b058cf5852d38ded7a42d6292f5.png)
.If
![1\leq r \leq 9](/media/m/f/5/c/f5c1cf26e6751d2514b6a80d1f28c9c8.png)
we split the decimal representation of
![n](/media/m/a/e/5/ae594d7d1e46f4b979494cf8a815232b.png)
into a maximal right part
![R](/media/m/4/d/7/4d76ce566584cfe8ff88e5f3e8b8e823.png)
that solely consists of digits not less than
![r](/media/m/3/d/f/3df7cc5bbfb7b3948b16db0d40571068.png)
and into a left part
![L](/media/m/f/c/1/fc1ae4eb78da7d1352cbf1f8217ab286.png)
that either is empty or ends with a digit strictly smaller than
![r](/media/m/3/d/f/3df7cc5bbfb7b3948b16db0d40571068.png)
. Then the decimal representation of
![h(n)](/media/m/2/6/7/267032991ac22212e488868b1dde2d7c.png)
consists of the decimal representation of
![L](/media/m/f/c/1/fc1ae4eb78da7d1352cbf1f8217ab286.png)
, followed by two copies of the decimal representation of
![R-1](/media/m/e/f/e/efe56e8bb4f2a6b74e8ff492b7d24db5.png)
. For instance, for the number
![17,151,345,543](/media/m/c/1/c/c1cd4518428f086e708466efebebae87.png)
, we will have
![L=17,151](/media/m/5/3/8/53827d3c8b087974c3c2ea2275f85a4e.png)
,
![R=345,543](/media/m/4/6/1/461ba38613e875330369b12c742ff4b4.png)
and
![h(n)=17,151,345,542,345,542](/media/m/2/4/f/24fa0620b97c87abbf8100d3989c9895.png)
.Prove that, starting with an arbitrary integer
![n\geq 2](/media/m/e/d/b/edbb3c15913fef4235c90cca2333a608.png)
, iterated application of
![h](/media/m/e/4/3/e438ac862510e579cf5cbdbe5904d4ba.png)
produces the integer
![1](/media/m/a/9/1/a913f49384c0227c8ea296a725bfc987.png)
after finitely many steps.
Proposed by Gerhard Woeginger, Austria
%V0
For any integer $n\geq 2$, we compute the integer $h(n)$ by applying the following procedure to its decimal representation. Let $r$ be the rightmost digit of $n$.
If $r=0$, then the decimal representation of $h(n)$ results from the decimal representation of $n$ by removing this rightmost digit $0$.If $1\leq r \leq 9$ we split the decimal representation of $n$ into a maximal right part $R$ that solely consists of digits not less than $r$ and into a left part $L$ that either is empty or ends with a digit strictly smaller than $r$. Then the decimal representation of $h(n)$ consists of the decimal representation of $L$, followed by two copies of the decimal representation of $R-1$. For instance, for the number $17,151,345,543$, we will have $L=17,151$, $R=345,543$ and $h(n)=17,151,345,542,345,542$.Prove that, starting with an arbitrary integer $n\geq 2$, iterated application of $h$ produces the integer $1$ after finitely many steps.
Proposed by Gerhard Woeginger, Austria