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.$
Problem
Source: IMO ShortList 1990, Problem 18 (NOR 1)
Tags: function, algebra, recurrence relation, recursion, IMO Shortlist
pco
02.06.2009 14:02
orl wrote: 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.$ I suppose we must read "$ n - b$, if $ n > M$" (instead of "$ n\geq M$")
If $ k(x)$ is the least cycle for $ x$, we have $ f^{k(x)}(x) = x$, then we have $ p(x)a - q(x)b = 0$ where $ p(x)$ is the number of "$ + a$" moves and $ q(x)$ the number of "$ - b$" moves for the least cycle (and so $ p(x) + q(x) = k(x)$)
And so the least values possible for $ p(x)$ and $ q(x)$ are $ p(x) = \frac {b}{\gcd(a,b)}$ and $ q(x) = \frac {a}{\gcd(a,b)}$
So $ k(x)\geq \frac {a + b}{\gcd(a,b)}$
Now, if $ x = 0$, $ f^i(0)$ can only take values in $ ([\frac {a + b}{2}] - b,[\frac {a + b}{2}] + a]$, all multiples of $ \gcd(a,b)$ (since the starting value $ 0$ is such a multiple), so $ \frac {a + b}{\gcd(a,b)}$ values.
So a cycle is encountered in the first $ \frac {a + b}{\gcd(a,b)}$ moves. As a consequence, this cycle includes $ 0$ (else we would have a cycle whose length would be $ < \frac {a + b}{\gcd(a,b)}$
And so the result : $ k(0) = \frac {a + b}{\gcd(a,b)}$
(Remark : with some other departure points, the cycle may not involve the departure point and so $ k(x) > \frac {a + b}{\gcd(a,b)}$)