Find the general term of the sequence defined by $a_{0}=1, a_{n+1}=2 a_{n}+n$.

.
Without generating function: Let $b_{n}=a_{n}+n+1$ (slightly parachuted). We have $b_{0}=2$ and

$$
b_{n+1}=a_{n+1}+n+2=2 a_{n}+2 n+2=2 b_{n}
$$

Therefore, $b_{n}=2^{n} b_{0}=2^{n+1}$ and $a_{n}=b_{n}-n-1=2^{n+1}-n-1$.

With generating function: Let $A$ be the generating function of the $a_{n}$. We have

$$
A=\sum a_{n} X^{n}=1+X \sum a_{n+1} X^{n}=1+X \sum\left(2 a_{n}+n\right) X^{n}=1+2 X A+\frac{X}{(1-X)^{2}}-\frac{X}{1-X}
$$

Thus,

$$
A=\frac{1-\frac{1}{1-X}+\frac{1}{(1-X)^{2}}}{1-2 X}=\frac{1-2 X+2 X^{2}}{(1-X)^{2}(1-2 X)}=\frac{2}{1-2 X}-\frac{1}{(1-X)^{2}}
$$

where the last expression is obtained by partial fraction decomposition. Therefore, the answer is $2 \cdot 2^{n}-(n+1)=2^{n+1}-n-1$.