
99.1. The function $f$ is defined for non-negative integers and satisfies the condition

$$
f(n)= \begin{cases}f(f(n+11)), & \text { if } n \leq 1999 \\ n-5, & \text { if } n>1999\end{cases}
$$

Find all solutions of the equation $f(n)=1999$.


Solution. If $n \geq 2005$, then $f(n)=n-5 \geq 2000$, and the equation $f(n)=1999$ has no solutions. Let $1 \leq k \leq 4$. Then

$$
\begin{gathered}
2000-k=f(2005-k)=f(f(2010-k)) \\
=f(1999-k)=f(f(2004-k))=f(1993-k)
\end{gathered}
$$

Let $k=1$. We obtain three solutions $1999=f(2004)=f(1998)=f(1992)$. Moreover, $1995=f(2000)=f(f(2005))=f(1994)$ and $f(1993)=f(f(2004))=f(1999)=$ $f(f(2010))=f(2005)=2000$. So we have shown that $2000-k=f(1999-k)$, for $k=0,1,2,3,4,5$, and $2000-k=f(1993-k)$ for $k=0,1,2,3,4$. We now show by downwards induction that $f(6 n+1-k)=2000-k$ for $n \leq 333$ and $0 \leq k \leq 5$. This has already been proved for $n=333$ and $n=332$. We assume that the claim is true for $n=m+2$ and $n=m+1$. Then $f(6 m+1-k)=f(f(6 m+12-k))=$ $f(f(6(m+2)+1-(k+1))=f(2000-k-1)=f(1999-k)=2000-k$ for $k=0,1,2,3,4$, and $f(6 m+1-5)=f(6 m-4)=f(f(6 m+7))=f(f(6(m+1)+1))=f(2000)=1995=2000-5$. So the claim is true for $n=m$. Summing up, $1999=2000-1=f(6 n)$, if and only if $n=1,2, \ldots, 334$.
