IMO 2009 · Problem 5

Determine all functions \(f\) from the set of positive integers to the set of positive integers such that, for all positive integers \(a\) and \(b\), there exists a non-degenerate triangle with sides of lengths \[ a,\quad f(b)\quad\text{and}\quad f(b+f(a)-1). \]

(A triangle is non-degenerate if its vertices are not collinear.)

Official text of the problem. Official problem paper (PDF)

Answer

The unique function is \[ \boxed{f(n)=n\quad\text{for every positive integer }n.} \]

Solution

The triangle inequalities give, for every pair of positive integers \(a,b\), \[ \left|f(b+f(a)-1)-f(b)\right|<a <f(b)+f(b+f(a)-1). \tag{1} \]

First we prove that \(f(1)=1\). Put \(c=f(1)\). Taking \(a=1\) in (1), and using the fact that the function takes integer values, gives \[ f(b+c-1)=f(b)\qquad(b\ge1). \] If \(c>1\), this makes \(f\) periodic with positive period \(c-1\), so it is bounded above by \[ M=\max\{f(1),f(2),\ldots,f(c-1)\}. \] But taking \(a=2M\) in the right-hand inequality of (1) would give \[ 2M<f(b)+f(b+f(2M)-1)\le2M, \] a contradiction. Therefore \(f(1)=1\).

Now take \(b=1\). The required triangle has sides \[ a,\quad 1,\quad f(f(a)). \] Consequently, \[ |a-f(f(a))|<1. \] Both quantities are integers, so \[ f(f(a))=a\qquad(a\ge1). \tag{2} \] In particular, \(f\) is injective.

Set \[ d=f(2)-1. \] Since \(f(1)=1\) and \(f\) is injective, \(f(2)\ne1\), hence \(d\ge1\). Taking \(a=2\) in (1) gives \[ |f(b+d)-f(b)|<2. \] The two values are distinct integers, again by injectivity, so \[ |f(b+d)-f(b)|=1\qquad(b\ge1). \tag{3} \]

Consider the sequence \[ x_k=f(1+kd)\qquad(k\ge0). \] Its terms are distinct positive integers, \(x_0=1\), and (3) says that successive terms differ by exactly \(1\). We claim that \[ x_k=k+1\qquad(k\ge0). \tag{4} \] Indeed, \(x_1=2\), since it is positive and differs from \(1\) by \(1\). If \(x_{k-1}=k\) and \(x_k=k+1\), then \(x_{k+1}\) is either \(k\) or \(k+2\). The former repeats \(x_{k-1}\), so \(x_{k+1}=k+2\). This proves (4) by induction.

Taking \(k=d\) in (4), we obtain \[ f(1+d^2)=d+1=f(2). \] Injectivity now gives \(1+d^2=2\). Since \(d\ge1\), we have \(d=1\). Thus (4) becomes \[ f(k+1)=k+1\qquad(k\ge0), \] as required.

Finally, for \(f(n)=n\), the proposed side lengths are \[ a,\quad b,\quad a+b-1. \] The last is a largest side, since \(a,b\ge1\), and \[ a+b>a+b-1. \] Thus these positive lengths satisfy all strict triangle inequalities and form a non-degenerate triangle. The function indeed satisfies the condition.

The solution was checked against the official IMO shortlist solutions.