# Exponential generating functions counting

How many $10$-digit numbers use only the digits $0, 1, 2$ with each digit appearing at least twice or not at all?

I know I need the coefficient of $\frac{x^{10}}{10!}$ in:

$$\left(1+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots \right)^3=(e^x-x)^3$$

but what do I do here?

• Expand the RHS. – David May 15 '15 at 6:04
• I expanded it but I don't see what to do from here. I don't see how to get an x^10 term when my highest term I have is x^3. – JackHallam May 15 '15 at 6:16
• What did you get when you expanded the RHS? – David May 15 '15 at 6:21
• i.gyazo.com/1791ce24af112318199c6d8bdcdfc8d8.png – JackHallam May 15 '15 at 6:22

You correctly expanded the RHS as $$(e^x)^3-3x(e^x)^2+3e^xx^2-x^3$$
Now write this as $$(e^{3x})-3x(e^{2x})+3e^xx^2-x^3$$
We look to the Taylor series of $e^{3x}$, found by substituting $y=3x$ in the Taylor series of $e^x$:
$$e^{3x} = 1+3x+\frac{3^2x^2}{2!} + \frac{3^3x^3}{3!} + \cdots + \frac{3^{10}x^{10}}{10!} + \cdots$$
Can you find those form $e^{2x}$ and $e^{x}$ yourself? If not, just leave a comment and I'll help you.