Olympiad Maths Prep

Track / Stage 10 / 3 of 40 #1963 of 2000

Problem 1963

Hardest shortlist tier
Algebra Difficulty 9.2 Prove it International Mathematical Olympiad Shortlisted Problems · IMO

Let Z0\mathbb{Z}_{\geqslant 0} be the set of all nonnegative integers. Find all the functions f:Z0Z0f: \mathbb{Z}_{\geqslant 0} \rightarrow \mathbb{Z}_{\geqslant 0} satisfying the relation
f(f(f(n)))=f(n+1)+1 f(f(f(n)))=f(n+1)+1
for all nZ0n \in \mathbb{Z}_{\geqslant 0}.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

Answer. There are two such functions: f(n)=n+1f(n)=n+1 for all nZ0n \in \mathbb{Z}_{\geqslant 0}, and
f(n)={n+1,n0(mod4) or n2(mod4),n+5,n1(mod4),n3,n3(mod4) for all nZ0 f(n)=\left\{\begin{array}{ll} n+1, & n \equiv 0(\bmod 4) \text{ or } n \equiv 2(\bmod 4), \\ n+5, & n \equiv 1(\bmod 4), \\ n-3, & n \equiv 3(\bmod 4) \end{array} \quad \text{ for all } n \in \mathbb{Z}_{\geqslant 0}\right.
Throughout all the solutions, we write hk(x)h^{k}(x) to abbreviate the kkth iteration of function hh, so h0h^{0} is the identity function, and hk(x)=h(hk times(x)))h^{k}(x)=\underbrace{h(\ldots h}_{k \text{ times}}(x) \ldots)) for k1k \geqslant 1.

Solution 1. To start, we get from (*) that
f4(n)=f(f3(n))=f(f(n+1)+1) and f4(n+1)=f3(f(n+1))=f(f(n+1)+1)+1 f^{4}(n)=f(f^{3}(n))=f(f(n+1)+1) \quad \text{ and } \quad f^{4}(n+1)=f^{3}(f(n+1))=f(f(n+1)+1)+1
thus
f4(n)+1=f4(n+1) \begin{equation*} f^{4}(n)+1=f^{4}(n+1) \tag{2} \end{equation*}
I. Let us denote by RiR_{i} the range of fif^{i}; note that R0=Z0R_{0}=\mathbb{Z}_{\geqslant 0} since f0f^{0} is the identity function. Obviously, R0R1R_{0} \supseteq R_{1} \supseteq \ldots. Next, from (2) we get that if aR4a \in R_{4} then also a+1R4a+1 \in R_{4}. This implies that Z0\R4\mathbb{Z}_{\geqslant 0} \backslash R_{4} - and hence Z0\R1\mathbb{Z}_{\geqslant 0} \backslash R_{1} - is finite. In particular, R1R_{1} is unbounded.
Assume that f(m)=f(n)f(m)=f(n) for some distinct mm and nn. Then from ()(*) we obtain f(m+1)=f(n+1)f(m+1)= f(n+1); by an easy induction we then get that f(m+c)=f(n+c)f(m+c)=f(n+c) for every c0c \geqslant 0. So the function f(k)f(k) is periodic with period mn|m-n| for kmk \geqslant m, and thus R1R_{1} should be bounded, which is false. So, ff is injective.
II. Denote now Si=Ri1\RiS_{i}=R_{i-1} \backslash R_{i}; all these sets are finite for i4i \leqslant 4. On the other hand, by the injectivity we have nSif(n)Si+1n \in S_{i} \Longleftrightarrow f(n) \in S_{i+1}. By the injectivity again, ff implements a bijection between SiS_{i} and Si+1S_{i+1}, thus S1=S2=\left|S_{1}\right|=\left|S_{2}\right|=\ldots; denote this common cardinality by kk. If 0R30 \in R_{3} then 0=f(f(f(n)))0=f(f(f(n))) for some nn, thus from (*) we get f(n+1)=1f(n+1)=-1 which is impossible. Therefore 0R0\R3=S1S2S30 \in R_{0} \backslash R_{3}=S_{1} \cup S_{2} \cup S_{3}, thus k1k \geqslant 1.
Next, let us describe the elements bb of R0\R3=S1S2S3R_{0} \backslash R_{3}=S_{1} \cup S_{2} \cup S_{3}. We claim that each such element satisfies at least one of three conditions (i) b=0b=0, (ii) b=f(0)+1b=f(0)+1, and (iii) b1S1b-1 \in S_{1}. Otherwise b1Z0b-1 \in \mathbb{Z}_{\geqslant 0}, and there exists some n>0n>0 such that f(n)=b1f(n)=b-1; but then f3(n1)=f(n)+1=bf^{3}(n-1)=f(n)+1=b, so bR3b \in R_{3}.
This yields
3k=S1S2S31+1+S1=k+2 3 k=\left|S_{1} \cup S_{2} \cup S_{3}\right| \leqslant 1+1+\left|S_{1}\right|=k+2
or k1k \leqslant 1. Therefore k=1k=1, and the inequality above comes to equality. So we have S1={a}S_{1}=\{a\}, S2={f(a)}S_{2}=\{f(a)\}, and S3={f2(a)}S_{3}=\left\{f^{2}(a)\right\} for some aZ0a \in \mathbb{Z}_{\geqslant 0}, and each one of the three options (i), (ii), and (iii) should be realized exactly once, which means that
{a,f(a),f2(a)}={0,a+1,f(0)+1} \begin{equation*} \left\{a, f(a), f^{2}(a)\right\}=\{0, a+1, f(0)+1\} \tag{3} \end{equation*}
III. From (3), we get a+1{f(a),f2(a)}a+1 \in\left\{f(a), f^{2}(a)\right\} (the case a+1=aa+1=a is impossible). If a+1=f2(a)a+1=f^{2}(a) then we have f(a+1)=f3(a)=f(a+1)+1f(a+1)=f^{3}(a)=f(a+1)+1 which is absurd. Therefore
f(a)=a+1 \begin{equation*} f(a)=a+1 \tag{4} \end{equation*}
Next, again from (3) we have 0{a,f2(a)}0 \in\left\{a, f^{2}(a)\right\}. Let us consider these two cases separately.
Case 1. Assume that a=0a=0, then f(0)=f(a)=a+1=1f(0)=f(a)=a+1=1. Also from (3) we get f(1)=f2(a)=f(0)+1=2f(1)=f^{2}(a)= f(0)+1=2. Now, let us show that f(n)=n+1f(n)=n+1 by induction on nn; the base cases n1n \leqslant 1 are established. Next, if n2n \geqslant 2 then the induction hypothesis implies
n+1=f(n1)+1=f3(n2)=f2(n1)=f(n) n+1=f(n-1)+1=f^{3}(n-2)=f^{2}(n-1)=f(n)
establishing the step. In this case we have obtained the first of two answers; checking that is satisfies (*) is straightforward.
Case 2. Assume now that f2(a)=0f^{2}(a)=0; then by (3) we get a=f(0)+1a=f(0)+1. By (4) we get f(a+1)=f2(a)=0f(a+1)= f^{2}(a)=0, then f(0)=f3(a)=f(a+1)+1=1f(0)=f^{3}(a)=f(a+1)+1=1, hence a=f(0)+1=2a=f(0)+1=2 and f(2)=3f(2)=3 by (4). To summarize,
f(0)=1,f(2)=3,f(3)=0 f(0)=1, \quad f(2)=3, \quad f(3)=0
Now let us prove by induction on mm that (1) holds for all n=4k,4k+2,4k+3n=4 k, 4 k+2,4 k+3 with kmk \leqslant m and for all n=4k+1n=4 k+1 with k<mk<m. The base case m=0m=0 is established above. For the step, assume that m1m \geqslant 1. From ( * ) we get f3(4m3)=f(4m2)+1=4mf^{3}(4 m-3)=f(4 m-2)+1=4 m. Next, by (2) we have
f(4m)=f4(4m3)=f4(4m4)+1=f3(4m3)+1=4m+1 f(4 m)=f^{4}(4 m-3)=f^{4}(4 m-4)+1=f^{3}(4 m-3)+1=4 m+1
Then by the induction hypothesis together with (*) we successively obtain
f(4m3)=f3(4m1)=f(4m)+1=4m+2f(4m+2)=f3(4m4)=f(4m3)+1=4m+3f(4m+3)=f3(4m3)=f(4m2)+1=4m \begin{aligned} & f(4 m-3)=f^{3}(4 m-1)=f(4 m)+1=4 m+2 \\ & f(4 m+2)=f^{3}(4 m-4)=f(4 m-3)+1=4 m+3 \\ & f(4 m+3)=f^{3}(4 m-3)=f(4 m-2)+1=4 m \end{aligned}
thus finishing the induction step.
Finally, it is straightforward to check that the constructed function works:
f3(4k)=4k+7=f(4k+1)+1,f3(4k+1)=4k+4=f(4k+2)+1,f3(4k+2)=4k+1=f(4k+3)+1,f3(4k+3)=4k+6=f(4k+4)+1. \begin{aligned} f^{3}(4 k) & =4 k+7=f(4 k+1)+1, & & f^{3}(4 k+1)=4 k+4=f(4 k+2)+1, \\ f^{3}(4 k+2) & =4 k+1=f(4 k+3)+1, & & f^{3}(4 k+3)=4 k+6=f(4 k+4)+1 . \end{aligned}

Solution 2. I. For convenience, let us introduce the function g(n)=f(n)+1g(n)=f(n)+1. Substituting f(n)f(n) instead of nn into (*) we obtain
f4(n)=f(f(n)+1)+1, or f4(n)=g2(n) \begin{equation*} f^{4}(n)=f(f(n)+1)+1, \quad \text{ or } \quad f^{4}(n)=g^{2}(n) \tag{5} \end{equation*}
Applying ff to both parts of (*) and using (5) we get
f4(n)+1=f(f(n+1)+1)+1=f4(n+1) \begin{equation*} f^{4}(n)+1=f(f(n+1)+1)+1=f^{4}(n+1) \tag{6} \end{equation*}
Thus, if g2(0)=f4(0)=cg^{2}(0)=f^{4}(0)=c then an easy induction on nn shows that
g2(n)=f4(n)=n+c,nZ0 \begin{equation*} g^{2}(n)=f^{4}(n)=n+c, \quad n \in \mathbb{Z}_{\geqslant 0} \tag{7} \end{equation*}
This relation implies that both ff and gg are injective: if, say, f(m)=f(n)f(m)=f(n) then m+c=f4(m)=f4(n)=n+cm+c= f^{4}(m)=f^{4}(n)=n+c. Next, since g(n)1g(n) \geqslant 1 for every nn, we have c=g2(0)1c=g^{2}(0) \geqslant 1. Thus from (7) again we obtain f(n)nf(n) \neq n and g(n)ng(n) \neq n for all nZ0n \in \mathbb{Z}_{\geqslant 0}.
II. Next, application of ff and gg to (7) yields
f(n+c)=f5(n)=f4(f(n))=f(n)+c and g(n+c)=g3(n)=g(n)+c. \begin{equation*} f(n+c)=f^{5}(n)=f^{4}(f(n))=f(n)+c \quad \text{ and } \quad g(n+c)=g^{3}(n)=g(n)+c . \tag{8} \end{equation*}
In particular, this means that if mn(modc)m \equiv n(\bmod c) then f(m)f(n)(modc)f(m) \equiv f(n)(\bmod c). Conversely, if f(m)f(n)(modc)f(m) \equiv f(n)(\bmod c) then we get m+c=f4(m)f4(n)=n+c(modc)m+c=f^{4}(m) \equiv f^{4}(n)=n+c(\bmod c). Thus,
mn(modc)f(m)f(n)(modc)g(m)g(n)(modc). \begin{equation*} m \equiv n(\bmod c) \Longleftrightarrow f(m) \equiv f(n) \quad(\bmod c) \Longleftrightarrow g(m) \equiv g(n) \quad(\bmod c) . \tag{9} \end{equation*}
Now, let us introduce the function δ(n)=f(n)n=g(n)n1\delta(n)=f(n)-n=g(n)-n-1. Set
S=n=0c1δ(n) S=\sum_{n=0}^{c-1} \delta(n)
Using (8), we get that for every complete residue system n1,,ncn_{1}, \ldots, n_{c} modulo cc we also have
S=i=1cδ(ni) S=\sum_{i=1}^{c} \delta\left(n_{i}\right)
By (9), we get that {fk(n):n=0,,c1}\left\{f^{k}(n): n=0, \ldots, c-1\right\} and {gk(n):n=0,,c1}\left\{g^{k}(n): n=0, \ldots, c-1\right\} are complete residue systems modulo cc for all kk. Thus we have
c2=n=0c1(f4(n)n)=k=03n=0c1(fk+1(n)fk(n))=k=03n=0c1δ(fk(n))=4S c^{2}=\sum_{n=0}^{c-1}\left(f^{4}(n)-n\right)=\sum_{k=0}^{3} \sum_{n=0}^{c-1}\left(f^{k+1}(n)-f^{k}(n)\right)=\sum_{k=0}^{3} \sum_{n=0}^{c-1} \delta\left(f^{k}(n)\right)=4 S
and similarly
c2=n=0c1(g2(n)n)=k=01n=0c1(gk+1(n)gk(n))=k=01n=0c1(δ(gk(n))+1)=2S+2c c^{2}=\sum_{n=0}^{c-1}\left(g^{2}(n)-n\right)=\sum_{k=0}^{1} \sum_{n=0}^{c-1}\left(g^{k+1}(n)-g^{k}(n)\right)=\sum_{k=0}^{1} \sum_{n=0}^{c-1}\left(\delta\left(g^{k}(n)\right)+1\right)=2 S+2 c
Therefore c2=4S=22S=2(c22c)c^{2}=4 S=2 \cdot 2 S=2\left(c^{2}-2 c\right), or c2=4cc^{2}=4 c. Since c0c \neq 0, we get c=4c=4. Thus, in view of (8) it is sufficient to determine the values of ff on the numbers 0,1,2,30,1,2,3.
III. Let d=g(0)1d=g(0) \geqslant 1. Then g(d)=g2(0)=0+c=4g(d)=g^{2}(0)=0+c=4. Now, if d4d \geqslant 4, then we would have g(d4)=g(d)4=0g(d-4)=g(d)-4=0 which is impossible. Thus d{1,2,3}d \in\{1,2,3\}. If d=1d=1 then we have f(0)=g(0)1=0f(0)=g(0)-1=0 which is impossible since f(n)nf(n) \neq n for all nn. If d=3d=3 then g(3)=g2(0)=4g(3)=g^{2}(0)=4 and hence f(3)=3f(3)=3 which is also impossible. Thus g(0)=2g(0)=2 and hence g(2)=g2(0)=4g(2)=g^{2}(0)=4.
Next, if g(1)=1+4kg(1)=1+4 k for some integer kk, then 5=g2(1)=g(1+4k)=g(1)+4k=1+8k5=g^{2}(1)=g(1+4 k)=g(1)+4 k=1+8 k which is impossible. Thus, since {g(n):n=0,1,2,3}\{g(n): n=0,1,2,3\} is a complete residue system modulo 4 , we get g(1)=3+4kg(1)=3+4 k and hence g(3)=g2(1)4k=54kg(3)=g^{2}(1)-4 k=5-4 k, leading to k=0k=0 or k=1k=1. So, we obtain iether
f(0)=1,f(1)=2,f(2)=3,f(3)=4, or f(0)=1,f(1)=6,f(2)=3,f(3)=0 f(0)=1, f(1)=2, f(2)=3, f(3)=4, \quad \text{ or } \quad f(0)=1, f(1)=6, f(2)=3, f(3)=0
thus arriving to the two functions listed in the answer.
Finally, one can check that these two function work as in Solution 1. One may simplify the checking by noticing that (8) allows us to reduce it to n=0,1,2,3n=0,1,2,3.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.