1. Define the problem and notation:
We are given functions f:N→N and g:N→N such that g assumes infinitely many values. We need to find all positive integers k for which the equation
fg(n)(n)=f(n)+k
holds for every positive integer n. Here, fi denotes the function f applied i times.
2. **Introduce the assertion P(n):**
Let P(n) denote the assertion fg(n)(n)=f(n)+k.
3. Sublemma 01:
There exists m0 such that f(m)=f(n)+ak for any n,a∈N.
Proof:
We use induction. Notice that there exists an integer m1 such that f(m1)=f(n)+k. Consider P(m1), we then have m2 such that f(m2)=f(m1)+k=f(n)+2k. Continuing this by induction, we get our desired result.
4. Sublemma 02:
For any integer ℓ,m, we have fℓ(f(n)+mk)=fℓ+1(n)+mk.
Proof:
We prove this by induction. By the standard trick,
f(f(n)+k)=f(fg(n)(n))=fg(n)(f(n))=f(f(n))+k
Therefore, we can get that if fℓ(f(n)+k)=fℓ+1(n)+k, then
fℓ+1(f(n)+k)=fℓ(f(f(n))+k)=fℓ+1(f(n))+k=fℓ+2(n)+k
Now consider ma−1 such that f(ma−1)=f(n)+(a−1)k=f(ma−2)+k which exists by Sublemma 01, then
fℓ(ma)=fℓ−1(f(ma−1)+k)=fℓ(ma−1)+k⇒fℓ(f(n)+ak)=fℓ+1(n)+ak
5. Main Claim:
There doesn't exist any value of ℓ>0 such that fℓ(n)=n for any n∈N.
Proof:
Define A as the set of values of fk(n), where k∈N. To prove this, we'll prove that fa(n)+ak∈A for any a∈N. We'll prove this by induction. For n=1, this is obvious. Then, plug P(fg(n)(n)) and we have
fg(f(n)+k)+g(n)(n)=f(f(n))+2k
Now, suppose fa(n)+ak∈A, then we have fXn,a(n)=fa(n)+ak for some n,a and Xn,a is a variable depending on n and a. Then, replace all n with fg(n)(n)=f(n)+k, we get
fXf(n)+k,a+g(n)(n)=fa(f(n)+k)+ak=fa+1(n)+(a+1)k
Therefore, we are done by induction. Now notice that the sequence {fi(k)+ik}i=1∞ is unbounded. Since they are all members of A, then ∣A∣=+∞. However, if there exists ℓ such that fℓ(n)=n, then ∣A∣ is finite, a contradiction.
6. Final steps:
Now, to finish this problem off. Notice that P(f(n)+ak) gives us
fg(f(n)+ak)(f(n)+ak)=f(f(n)+ak)+k
By our lemma, fg(f(n)+ak)+1(n)+ak=LHS=RHS=f(f(n))+(a+1)k, which therefore gives us
fg(f(n)+ak)+1(n)=f(f(n))+k
for any a∈N. However, this gives us
fg(f(n)+ak)+1(n)=f(f(n))+k=f(f(n)+k)=f(fg(n)(n))=fg(n)+1(n)
Therefore, we have
f∣g(f(n)+ak)−g(n)∣(n)=n
for all n∈N. Therefore, we have g(n)=g(f(n)+ak) for all a∈N. For k=1, there are no such functions obviously as this contradicts g is unbounded.
7. **Construction for k≥2:**
Consider f(kn)=nk+1 and f(nk+1)=kn+2. For any a, which is not a power of k, we can let f(ak)=ak+2 and define f(x)=x+1 for any other integers x not mentioned. One can define g(n) to be the smallest m satisfying fm(n)=f(n)+k. One can check that g is unbounded since g(nk+1) is the number of integers m such that kn+2≤m≤kn+1 and k∤m−1.
The final answer is all k≥2