Exercise 4. For any strictly positive integer $k$, if $k$ is written on the board, it can be erased and replaced by the number $a+b$, provided that $a$ and $b$ are strictly positive integers such that $a b=k$ (for example, 20 can be replaced by 12, since $12=2+10$ and $20=2 \times 10$).

Initially, the integer $n>0$ is written on the board. Determine, depending on the values of $n$, the smallest number that can be written on the board after a finite number of replacements (possibly none).
Solution to Exercise 4 Let $f(n)$ be the smallest number that can be obtained after a finite number of replacements.

First, note that if $a+b \leqslant 4$, then $a b \leqslant 4$. To prove this, we can assume without loss of generality that $a \geqslant b$, so ( $a=3$ and $b=1$ ) or ( $a=2$ and $b \leqslant 2$ ). In the first case, we have $a b=3$, and in the second case, we have $a b \leqslant 2 \times 2=4$.

This shows that if we start with a number $\geqslant 5$, after one replacement we always get a number $\geqslant 5$, and therefore after a finite number of replacements, the number obtained remains $\geqslant 5$.

Conversely, let $n \geqslant 6$.

If $n$ is even, since $n=2(n / 2)$, we can replace it with $2+(n / 2)$. Now, $2+(n / 2)5$.

We have thus shown that from any integer $n>5$, we can reach an integer strictly smaller than $n$, so after a finite number of steps, we reach the integer 5.

Conclusion: for all $n \geqslant 5$, we have $f(5)=5$.

Moreover, if $n<5$, then it is easy to verify that after a single replacement, we always get an integer $\geqslant n$, so $f(n)=n$ (achieved after zero replacements).