2. Let $n$ be a natural number, and let $c(n)$ denote the number of ways to write $n$ as a sum of powers of 2, where each power of 2 can appear at most three times. For example, $c(8)=5$:
$$
\begin{array}{l}
8=8=4+4=4+2+2=4+2+1+1=2+2+2+1 \\
+1 .
\end{array}
$$

Find $c(n)$ (44th Putnam Mathematical Competition)
2. Let $2 n=e_{0}+2 e_{1}+4 e_{2}+\cdots+2^{*} \cdot e_{k}$ be a partition of $2 n$, where $e_{0} \in\{0,2\}, e_{i} \in\{0,1,2,3\}(i=1,2,3$, $\cdots, k)$. If $e_{0}=0$, then $e_{1}+2 e_{2}+\cdots+2^{k-1} \cdot e_{k}$ is a partition of $n$. If $e_{0}=2$, then $e_{1}+2 e_{2}+\cdots+2^{k-1} \cdot e_{k}$ is a partition of $n-1$, showing that $C(2 n)=C(n)+C(n-1)$.

Similarly, $C(2 n+1)=C(n)+C(n-1)=C(2 n)$. Given $C(1)=1, C(2)=2$, it can be shown by induction that $C(n)=\left[1+\frac{n}{2}\right]$.