IMO Shortlist 1990 problem 18
Dodao/la:
arhiva2. travnja 2012. Let
![a, b \in \mathbb{N}](/media/m/b/7/f/b7fe81a6f89adb8b4a9d9d94c0b8bdf0.png)
with
![1 \leq a \leq b,](/media/m/b/5/9/b596e7e7cd36baa5910849fd83f0e613.png)
and
![M = \left[\frac {a + b}{2} \right].](/media/m/7/2/c/72cf1d082062d5caeb7a120b0b87a896.png)
Define a function
![f: \mathbb{Z} \mapsto \mathbb{Z}](/media/m/7/4/9/749a540797e5fd09412e55c0df664de7.png)
by
Let
![i = 1, 2, \ldots](/media/m/5/3/7/5374994cbb1fc142a9f97f0a4be24c1c.png)
Find the smallest natural number
![k](/media/m/f/1/3/f135be660b73381aa6bec048f0f79afc.png)
such that
%V0
Let $a, b \in \mathbb{N}$ with $1 \leq a \leq b,$ and $M = \left[\frac {a + b}{2} \right].$ Define a function $f: \mathbb{Z} \mapsto \mathbb{Z}$ by
$$f(n) = \begin{cases} n + a, & \text{if } n \leq M, \\ n - b, & \text{if } n \geq M. \end{cases}$$
Let $f^1(n) = f(n),$ $f_{i + 1}(n) = f(f^i(n)),$ $i = 1, 2, \ldots$ Find the smallest natural number $k$ such that $f^k(0) = 0.$
Izvor: Međunarodna matematička olimpijada, shortlist 1990