Let $\mathrm{n}$ be a strictly positive integer. How many polynomials $\mathrm{P}$ with coefficients in $\{0,1,2,3\}$ are there such that $P(2)=n$?

## - Other examples -
Let $a_{n}$ be the number sought, and $f(t)$ the generating function of the sequence $\left(a_{n}\right)$. For $i \geqslant 0$ we call $A_{i}=\left\{2^{i}, 2^{i+1}, 3 \cdot 2^{i}\right\}, a_{n}$ is the number of different ways to obtain $n$ by choosing at most one number from each of the $A_{i}$ and summing all the chosen numbers. The corresponding generating function is

$$
f(t)=\prod_{i \geqslant 0}\left(1+t^{2^{i}}+t^{2^{i+1}}+t^{3 \cdot 2^{i}}\right)=\prod_{i \geqslant 0} \frac{1-t^{2^{i+2}}}{1-t^{2^{i}}}=\frac{1}{1-t} \frac{1}{1-t^{2}}
$$

We find the same generating function as in Exercise 2, so $a_{n}=\left[\frac{n}{2}\right]+1$. For a solution without generating functions, we refer to Grésillon's 2011 course notes (Exercise 9 of combinatorics for advanced students).