The function $f$ is defined on the set of integers and satisfies \[f(n)= \begin{cases}  n-3 & \mbox{if }n\ge 1000 \\  f(f(n+5)) & \mbox{if }n<1000. \end{cases}\]Find $f(84)$.
Denote by (1) and (2) the two parts of the definition of $f$, respectively. If we begin to use the definition of $f$ to compute $f(84)$, we use (2) until the argument is at least $1000$: \[f(84) = f(f(89)) = f(f(f(94))) = \dots = f^N(1004)\](where $f^N$ denotes composing $f$ with itself $N$ times, for some $N$). The numbers $84, 89, 94, \dots, 1004$ form an arithmetic sequence with common difference $5$; since $1004 - 84 = 920 = 184 \cdot 5$, this sequence has $184 + 1 = 185$ terms, so $N = 185$.

At this point, (1) and (2) are both used: we compute \[\begin{aligned} f^N(1004) &\stackrel{(1)}{=} f^{N-1}(1001) \stackrel{(1)}{=} f^{N-2}(998) \stackrel{(2)}{=} f^{N-1}(1003) \stackrel{(1)}{=} f^{N-2}(1000) \\ &\stackrel{(1)}{=} f^{N-3}(997) \stackrel{(2)}{=} f^{N-2}(1002) \stackrel{(1)}{=} f^{N-3}(999) \stackrel{(2)}{=} f^{N-2}(1004). \end{aligned}\]Repeating this process, we see that \[f^N(1004) = f^{N-2}(1004) = f^{N-4}(1004) = \dots = f^3(1004).\](The pattern breaks down for $f^k(1004)$ when $k$ is small, so it is not true that $f^3(1004) = f(1004)$.) Now, we have \[f^3(1004) \stackrel{(1)}{=} f^2(1001) \stackrel{(1)}{=} f(998) \stackrel{(2)}{=} f^2(1003) \stackrel{(1)}{=} f(1000) \stackrel{(1)}{=} \boxed{997}.\]
997
Level 4
Intermediate Algebra
Problem: The function $f$ is defined on the set of integers and satisfies \[f(n)= \begin{cases}  n-3 & \mbox{if }n\ge 1000 \\  f(f(n+5)) & \mbox{if }n<1000. \end{cases}\]Find $f(84)$.
Solution:<|START_OF_LATENT|><|PRIOR_PREFIX|>To find \( f(84) \), we first note that \( 84 < 1000 \). Therefore, we use the second case of the function definition: 

\[
f(84) = f(f(89))
\]

Next, we need to evaluate \( f(89) \). Since \( 89 < 1000 \), we again apply the second case:

\[
f(89) = f(f(94))
\]

Continuing this process, we evaluate \( f(94) \):

\[
f(94) = f(f(99))
\]

Next, we evaluate \( f(99) \):

\[
f(99) = f(f(104))
\]

Now, since \( 104 \ge 1000 \), we use the first case:

\[
f(104) = 104 - 3 = 101
\]

Substituting back, we find:

\[
f(99) = f(101)
\]

Next, we evaluate \( f(101) \):

\[
f(101) = 101 - 3 = 98
\]

Now we can substitute back to find \( f(94) \):

\[
f(94) = f(98)
\]

Next, we evaluate \( f(98) \):

\[
f(98) = f(f(103))
\]

Since \( 103 \ge 1000 \):

\[
f(103) = 103 - 3 = 100
\]

Thus, we have:

\[
f(98) = f(100)
\]

Next, we evaluate \( f(100) \):

\[
f(100) = 100 - 3 = 97
\]

Now substituting back, we find:

\[
f(94) = f(98) = f(100) = 97
\]

Continuing back, we find:

\[
f(89) = f(94) = 97
\]

And then:

\[
f(84) = f(89) = 97
\]

Now we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f(102))
\]

Since \( 102 \ge 1000 \):

\[
f(102) = 102 - 3 = 99
\]

Thus:

\[
f(97) = f(99) = 98
\]

Continuing back, we find:

\[
f(84) = f(89) = 97
\]

Finally, we need to evaluate \( f(97) \):

\[
f(97) = f(f<|END_OF_LATENT|> The final answer is $997$.