27 Given the function $f(n)$ defined on the set of natural numbers, satisfying
$$
f(n)=\left\{\begin{array}{ll}
n-12 & \text { when } n>2000 \text { } \\
f(f(n+16)) & \text { when } n \leqslant 2000 \text { }
\end{array}\right.
$$
(i) Find $f(n)$.
(ii) Find all solutions to the equation $f(n)=n$.
27 (i) Let $n$ divided by 4, the remainder is $r(r \in\{0,1,2,3\})$.
When $2000 \geqslant n>1996$,
$$
\begin{aligned}
f(n) & =f(f(n+16))=f(n+16-12) \\
& =f(n+4)=n+4-12 \\
& =n-8=1996+r-8 \\
& =1988+r .
\end{aligned}
$$

When $1996 \geqslant n>1992$,
$$
\begin{aligned}
f(n) & =f(f(n+16))=f(n+16-12) \\
& =f(n+4)=1988+r .
\end{aligned}
$$

Similarly, when $2000 \geqslant n>1984$, $f(n)=1988+r$.
Assume that when $n>k(k \leqslant 1984)$, $f(n)=1988+r$, then when $k \geqslant n>k-4$,
$$
f(n)=f(f(n+16))=f(1988+r)=1988+r .
$$

Thus,
$$
f(n)=\left\{\begin{array}{l}
n-12, \text { if } n>2000 . \\
1988+r, \text { if } n \leqslant 2000 .
\end{array}\right.
$$
(ii) Clearly, the solution to $f(n)=n$ satisfies $n \leqslant 2000$ and
$$
1988+r=n
$$

Thus, $n=1989,1990,1991,1992$.