Problem

Source: IMO ShortList 1990, Problem 18 (NOR 1)

Tags: function, algebra, recurrence relation, recursion, IMO Shortlist



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 >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.$