MathLabs

Problem 3

Let 0<f(1)<f(2)<f(3)<…0<f(1)<f(2)<f(3)<\ldots be a sequence with all its terms positive integers. The nn-th positive integer which doesn't belong to the sequence is f(f(n))+1f(f(n))+1. Find f(240)f(240).
Step 5 of 5: Finish at the requested index
In plain words

The final application lands exactly on 240, so the requested value is forced.

f(240)=148+239+1=388f(240)=148+239+1=388
Detailed analysis

Now use f(148)=239f(148)=239 in the second relation with n=148n=148 and k=239k=239. Since k+1=240k+1=240, it gives f(240)=n+k+1=148+239+1=388f(240)=n+k+1=148+239+1=388.