Given a non-negative integer $n,$ let $t_n$ be the number of ways to partition $n$ using only powers of $2$ where each power is used at most three times, and let $r_n$ be the number of ways to partition $n$ using $1,2,3,9$ where $1$ and $3$ are used at most twice. Prove that $t_n = r_n.$
For $t_n,$ I let $n = \sum_i c_i2^i$ such that $0 \leq c_i \leq 3$ and then applied generating functions to give me $t_n = \lfloor \frac{n}{2} \rfloor + 1.$ However, I don't quite know how to calculate $r_n.$
Using $1$ and $3$ alone and at most twice each, we can write each of $0,1,2,3,4,5,6,7,8$ and in a unique way.
Hence $r_n$ is obtained by taking any suitable number $n_2$ of $2$'s, which allows $n_2=0,1,2,\ldots, \lfloor\frac n2\rfloor$ (so $\lfloor \frac n2\rfloor +1$ ways); then use $1$'s and $3$'s as above to get down to the nearest multiple of $9$; and finally use an according amount of $9$'s. We conclude $$r_n=\left\lfloor \frac n2\right\rfloor +1.$$