Maths WorkshopMaths problems with full solutions
Exercise 2238Calculus › Single-variable calculus › Continuity › Functional equationsOlympiadAdded 5 Nov 2026

A strictly increasing f with f(f(n)) = 3n

#functional equation#monotone#integers#ternary structure

Statement

Let f:N∗→N∗f:\mathbb{N}^*\to\mathbb{N}^* be strictly increasing with f(f(n))=3nf(f(n))=3n for all n≥1n\ge1. Determine f(n)f(n) completely and compute f(2024)f(2024).

Hint

First show f(3n)=3f(n)f(3n)=3f(n) and n<f(n)<3nn<f(n)<3n. Then find f(1)f(1) and f(2)f(2), and use monotonicity on the blocks [3k,2⋅3k][3^k,2\cdot3^k].

Show solutionHide solution

Solution

Step 1: f(3n)=3f(n)f(3n)=3f(n). f(3n)=f(f(f(n)))=3f(n)f(3n)=f(f(f(n)))=3f(n) (apply the equation to f(n)f(n)).

Step 2: n<f(n)<3nn<f(n)<3n. If f(n)≤nf(n)\le n, monotonicity gives 3n=f(f(n))≤f(n)≤n3n=f(f(n))\le f(n)\le n, impossible. If f(n)≥3nf(n)\ge3n, then 3n=f(f(n))≥f(3n)=3f(n)≥9n3n=f(f(n))\ge f(3n)=3f(n)\ge9n, impossible.

Step 3: small values. 1<f(1)<31<f(1)<3 so f(1)=2f(1)=2, and f(2)=f(f(1))=3f(2)=f(f(1))=3. By Step 1, f(3k)=2⋅3kf(3^k)=2\cdot3^k and f(2⋅3k)=3k+1f(2\cdot3^k)=3^{k+1}.

Step 4: first half of each block. The integers 3k,…,2⋅3k3^k,\dots,2\cdot3^k are 3k+13^k+1 numbers, and ff maps them strictly increasingly into {2⋅3k,…,3k+1}\{2\cdot3^k,\dots,3^{k+1}\}, which also has 3k+13^k+1 elements, with the end points matching. So the map is the shift:
f(3k+j)=2⋅3k+j,0≤j≤3k.f(3^k+j)=2\cdot3^k+j,\qquad0\le j\le3^k.

Step 5: second half. For 0≤j≤3k0\le j\le3^k, f(2⋅3k+j)=f(f(3k+j))=3(3k+j)=3k+1+3jf(2\cdot3^k+j)=f\bigl(f(3^k+j)\bigr)=3(3^k+j)=3^{k+1}+3j.

Formula. For 3k≤n≤2⋅3k3^k\le n\le2\cdot3^k: f(n)=n+3kf(n)=n+3^k. For 2⋅3k≤n≤3k+12\cdot3^k\le n\le3^{k+1}: f(n)=3n−3k+1f(n)=3n-3^{k+1}. (The two formulas agree at the common point n=2⋅3kn=2\cdot3^k: f=3k+1f=3^{k+1} in both. Both pieces are increasing and they match at the junction, so ff is strictly increasing.)

Verification. For nn in the first range, f(n)=n+3kf(n)=n+3^k lies in the second range, f(f(n))=3(n+3k)−3k+1=3nf(f(n))=3(n+3^k)-3^{k+1}=3n ✓. For nn in the second range, f(n)=3n−3k+1f(n)=3n-3^{k+1} lies in [3k+1,2⋅3k+1][3^{k+1},2\cdot3^{k+1}] and f(f(n))=3n−3k+1+3k+1=3nf(f(n))=3n-3^{k+1}+3^{k+1}=3n ✓.

The value. 36=7293^6=729, 2⋅36=14582\cdot3^6=1458, 37=21873^7=2187. Since 1458≤2024≤21871458\le2024\le2187 we use the second formula with k=6k=6:
f(2024)=3⋅2024−2187=3885.f(2024)=3\cdot2024-2187=3885.

Lesson. For f(f(n))=g(n)f(f(n))=g(n) with ff monotone, trap ff between two bounds, find the values on a geometric sequence, and use the pigeonhole/order argument to fill in the blocks.