<s>[INST] Find a generating function for which $A(n)={n \choose 2}$ In the book I'm using, $A(x)$ denotes the formal power series (generating function), $A(x) = \sum a_ix^i$.
I'm really stuck on this problem. Thanks for any help.
My attempt after the given hint:
$$\begin{align}
A(x)&=\sum_{n\geq 0} \binom{n}{2}x^n\\
&=\sum_{n\geq 0} \frac{x^2}{2}\frac{d^2}{dx^2}(x^{n})\\
&=\frac{x^2}{2} \frac{d^2}{dx^2}\sum_{n\geq 0} x^{n}\\
&=\frac{x^2}{2} \frac{d^2}{dx^2}\frac{1}{1-x}\\
&=\frac{x^2}{2} \frac{2}{(1-x)^3}
\end{align}$$
Sorry, I'm new to $\rm \LaTeX$.
 [/INST] Since $\binom{n}{2}x^n=\frac12 x^2\frac{d^2}{dx^2}x^n$, $$\sum_{n\ge 0}\binom{n}{2}x^n=\frac12 x^2\frac{d^2}{dx^2}\frac{1}{1-x}=\frac{x^2}{(1-x)^3}.$$We can double-check by the binomial theorem: the $x^n$ coefficient is $$\frac{(-1)^n}{(n-2)!}\prod_{j=1}^{n-2}(-2-j)=\frac{n!}{(n-2)!2!}=\binom{n}{2}.$$
</s>