Problem K. 667. (October 2020)
K. 667. Start with a positive integer. In each move, take the half of the number if it is even, or add 1 to the number if it is odd. The sequence of moves terminates if it reaches the number 1.
\(\displaystyle a)\) Is it true that whatever the starting number is, it is always possible to reach 1 sooner or later (with a finite number of moves)?
\(\displaystyle b)\) Is it true that at most 30 moves are sufficient to reach 1 if we start from a four-digit number?
(6 pont)
Deadline expired on November 10, 2020.
Sorry, the solution is available only in Hungarian. Google translation
Megoldás.
a) Ha a számunk az 1, akkor az 1-hez jutunk 0 lépésben.
Ha a számunk az 2, akkor az 1-hez jutunk 1 lépésben. (\(\displaystyle 2\rightarrow1\).)
Ha a számunk a 3, akkor az 1-hez jutunk 3 lépésben. (\(\displaystyle 3\rightarrow4\rightarrow2\rightarrow1\).)
Ha a számunk a 4, akkor az 1-hez jutunk 2 lépésben. (\(\displaystyle 4\rightarrow2\rightarrow1\).)
Ha a számunk az 5, akkor az 1-hez jutunk 5 lépésben. (\(\displaystyle 5\rightarrow6\rightarrow3\rightarrow4\rightarrow2\rightarrow1\).)
Ha a számunk a 6, akkor az 1-hez jutunk 4 lépésben. (\(\displaystyle 6\rightarrow3\rightarrow4\rightarrow2\rightarrow1\).)
Ha a számunk az 7, akkor az 1-hez jutunk 4 lépésben. (\(\displaystyle 7\rightarrow8\rightarrow4\rightarrow2\rightarrow1\).)
És így tovább.
Páros számból nála kisebb számhoz jutunk (a feléhez) egy lépésben, páratlan számból pedig a nála 1-gyel nagyobb szám feléhez jutunk 2 lépésben, így mindenképpen csökken az aktuális számunk 1 vagy 2 lépésben, vagyis előbb-utóbb eljutunk az 1-hez.
b) Próbáljuk ki pl. a 2018-at! \(\displaystyle 2018\rightarrow1009\rightarrow1010\rightarrow505\rightarrow506\rightarrow258\rightarrow129\rightarrow130\rightarrow\)
\(\displaystyle \rightarrow65\rightarrow66\rightarrow33\rightarrow34\rightarrow17\rightarrow18\rightarrow9\rightarrow10\rightarrow5\rightarrow6\rightarrow3\rightarrow4\rightarrow2\rightarrow1\).
Legrosszabb esetben kétlépésenként feleződik meg (kb.) a számunk (ilyenkor a felénél 0,5-del nagyobb számot kapunk), így mivel \(\displaystyle 213=8192<9999<214=16 384\), így legfeljebb 28 (27) lépés mindenképpen elegendő.
Keressünk meg visszafelé számolással egy hosszú lépést adó négyjegyű számot: \(\displaystyle 1\rightarrow2\rightarrow4\rightarrow3\rightarrow6\rightarrow5\rightarrow10\rightarrow9\rightarrow18\rightarrow17\rightarrow34\rightarrow33\rightarrow66\rightarrow65\rightarrow130\rightarrow129\rightarrow\)
\(\displaystyle \rightarrow258\rightarrow257\rightarrow514\rightarrow513\rightarrow1026\rightarrow
\rightarrow1025\rightarrow2050\rightarrow2049\rightarrow4098\rightarrow4097\rightarrow8194\rightarrow8193\).
A 8193-ból kiindulva valóban 27 lépés kell.
Statistics:
Problems in Mathematics of KöMaL, October 2020