Problem
ALG-B3-M01-P010 Shift on positive integers
#10
★★★★☆ Level 4 of 5
Find all strictly increasing \(f:\mathbb N\to\mathbb N\) such that \(f(f(n))=n+2\) for all \(n\in\mathbb N\).
Hint. Compare \(f(n)\) with \(n\).
Since \(f\) is strictly increasing and takes positive integer values, \(f(n)\ge n\). If \(f(k)\ge k+2\), then \(f(f(k))\ge f(k+2)\ge f(k)+2\ge k+4\), contradiction. Thus \(f(n)\le n+1\). Equality \(f(n)=n\) is impossible, since then \(f(f(n))=n\). Hence \(f(n)=n+1\), and verification gives \(f(f(n))=n+2\).
Goal: separate guessing the answer from a complete proof and domain check.