Question: Let the function $f: N \rightarrow N$ satisfy the conditions $f(1)=1, f(2 n+1)=f(2 n)+1, f(2 n)$ $=3 f(n)$. Find the value set of $f$.


Solution: We slightly modify the original problem. Let the function $g: N \rightarrow N$ satisfy
$$
\begin{array}{l}
g(1)=1, \\
g(2 n+1)=g(2 n)+1, \\
g(2 n)=2 g(n) .
\end{array}
$$

Using the first principle of mathematical induction, we can prove that this results in the identity mapping on $N$.

We already have $g(1)=1$. Assume $g(2)=2, g(3)=3$, $\cdots, g(k)=k$. If $k=2 m(m \in N)$, then
$$
\begin{array}{l}
g(k+\mathrm{i})=g(2 m+1) \\
=g(2 m)+1=g(k)+1=k+1 ;
\end{array}
$$

If $k \doteq 2 m-1$, then
$$
\begin{array}{l}
g(k+1)=g(2 m)=2 g(m)=2 m \\
=k+1 .
\end{array}
$$

Thus, for all $n \in N$, we have $g(n)=n$.
Let the binary representation of $n$ be
$$
n=\left(a_{r} a_{r-1} \cdots a_{1} a_{0}\right)_{2} .
$$

Then, from the above proof, for the original problem, we have
$$
\begin{array}{l}
f(n)=a_{r} \cdot 3^{r}+a_{r-1} \cdot 3^{r-1}+\cdots+a_{1} \cdot 3 \\
+a_{0}\left(a_{r}=1, a_{j}=0 \text { or } 1, j=0,1, \cdots ; r-1\right) .
\end{array}
$$

Therefore, the value set of $f$ is
$$
\begin{array}{l}
\quad\left\{\sum_{i=0}^{r} a_{i} 3^{i} \mid a_{r}=1, a_{j}=0 \text { or } 1, j=0,1, \cdots,\right. \\
r-1, r \in N\} .
\end{array}
$$

Similarly, we can prove the generalized proposition:
Let the function $f: N \rightarrow N$ satisfy the conditions
$$
\begin{array}{l}
f(1)=1, f(2 n+1)=f(2 n)+1, \\
f(2 n)=k f(n) .
\end{array}
$$

Then the value set of $f$ is
$$
\begin{array}{l}
\left\{\sum_{i=0}^{r} a_{i} k^{r} \mid a_{r}=1, a_{j}=0 \text { or } 1, j=0,1, \cdots,\right. \\
r-1, r \in N\} .
\end{array}
$$