6・17 Function $f$ is defined on the set of integers, and satisfies
$$
f(n)=\left\{\begin{array}{l}
n-3, \quad \text { when } n \geqslant 1000 ; \\
f(f(n+5)), \quad \text { when } n<1000 .
\end{array}\right.
$$

Find $f(84)$.
[Solution] Since $84+5 \times 184=1004>1000$, we have
$$
\begin{array}{l}
f(84)=\underline{f}(1004)=\underline{f \cdots f}(1001) \\
185 \text { times 184 times } \\
=\underline{f \cdots f}(998)=\underline{f} \boldsymbol{f \cdots f}(1003) \\
183 \text { times 184 times } \\
=\underline{f \cdots f}(1000)=\underline{f \cdots f}(997) \\
183 \text { times } 182 \text { times } \\
=\underline{f \cdots f}(1002)=\underline{f \cdots f}(999) \\
183 \text { times } 182 \text { times } \\
=\underbrace{f \cdots f}(1004)=\cdots \\
183 \text { times } \\
=f f f(1004)=\cdots \\
=f(1000)=997 \text {. } \\
\end{array}
$$

We can use mathematical induction to prove a stronger conclusion:
$$
f(n)\left\{\begin{array}{l}
997, \text { when } n \text { is an even number less than } 1000, \\
998, \text { when } n \text { is an odd number less than } 1000. \\
\end{array}\right.
$$