Determine the number of ways to buy fruits knowing that apples are sold in packs of 2, bananas are sold in packs of 5, and there are only 4 oranges and 1 pear left.
We call $a_{n}$ the number of ways to buy $n$ fruits in this manner, and $A(X)$ the associated generating function.

The series associated with the number of apples is $1+X^{2}+X^{4}+X^{6}+\ldots=\frac{1}{1-X^{2}}$ The series associated with the number of bananas is $1+X^{5}+X^{10}+X^{15}+\ldots=\frac{1}{1-X^{5}}$ The series associated with the number of oranges is $1+X+X^{2}+X^{3}+X^{4}=\frac{1-X^{5}}{1-X}$ The series associated with the number of pears is $1+X$

Therefore, we have $A(X)=\frac{1}{1-X^{2}} \frac{1}{1-X^{5}} \frac{1-X^{5}}{1-X}(1+X)=\frac{1}{(1-X)^{2}}$ so the desired number is $(-1)^{n}\binom{-2}{n}=$ $(-1)^{n} \frac{(-2)(-3) \ldots(-2-n+1)}{n!}=n+1$