Finding the Formula for the Catalan Numbers and Motzkin Numbers

binomial theoremcatalan-numberscombinatoricsgenerating-functionspower series

I have derived the following generating function for the Catalan numbers:
$$C(x)=\frac{1-\sqrt{1-4x}}{2x}$$
Now I know my next step is to use the extended binomial theorem to expand
$$\sqrt{1-4x}=(1+(-4x))^{\frac{1}{2}}=\sum_{n\geq 0}\binom{\frac{1}{2}}{n}(-4x)^n$$
which will lead to a formula for the Catalan numbers.

Now my questions is can I do the same for the Motzkin Numbers?
I derived the following generating function
$$M(x)=\frac{1-x-\sqrt{1-2x-3x^2}}{2x^2}$$
Can I use the extended binomial theorem here as well?
$$\sqrt{1-2x-3x^2}=(1+(-2x-3x^2))^{\frac{1}{2}}=\sum_{n\geq 0}\binom{\frac{1}{2}}{n}(-2x-3x^2)^n$$
where we treat $(-2x-3x^2)$ as the $x$ term.
Furthermore, I want to ask is this the best/most efficient way to find a power series expansion that will lead me to the general formula? What other methods are there?
(Will Taylor's formula help too? I was thinking no since it will be tedious to take repetitive derivatives and it will be hard to guess a general formula from that)

Best Answer

You have made great progress so far, here is how you conclude. We want to derive a formula for $M_n$, where $M(x)=\sum_{n\ge 0}M_nx^n$. For any $n\ge 0$, $$ \begin{align} M_n &=[x^n]\frac{1-x-\sqrt{1-2x-3x^2}}{2x^2} \\&=[x^n]\frac{-\sqrt{1-2x-3x^2}}{2x^2} \\&=-\frac12[x^{n+2}](1-2x-3x^2)^{1/2}. \end{align} $$ As you calculated, $(1-2x-3x^2)^{1/2}=\sum_{k\ge 0}\binom{1/2}k(-2)^k\cdot x^k(1+\tfrac32x)^k$. Therefore, $$ \begin{align} M_n&=-\frac12[x^{n+2}](1-2x-3x)^{1/2} \\&=\sum_{k\ge 0}\binom{1/2}k(-2)^{k-1}[x^{n+2}]x^k(1+\tfrac32x)^k \\&=\sum_{k\ge 0}\binom{1/2}k(-2)^{k-1}\binom{k}{n+2-k}(3/2)^{n+2-k} \\&=(3/2)^{n+2}\sum_{k\ge 0}\color{#00a}{\binom{1/2}k(-1)^{k-1}2^{-(2k-1)}}\binom{k}{n+2-k}3^{-k}, \\M_n&=(3/2)^{n+2}\sum_{k\ge 1}\color{#00a}{\frac1k\binom{2k-2}{k-1}}\binom{k}{n+2-k}3^{-k}. \end{align} $$ This formula appears in the OEIS page for the Motzkin numbers.


You asked for alternate methods, so here is a different method which gives a different formula.

Recall that you can use a combinatorial argument to show that the Catalan generating function satisfies the equation $C(x)=1+xC(x)^2$, which is where the $C(x)=(1-\sqrt{1-4x})/2x$ formula comes from. In the same way, a combinatorial argument implies the equation $$M(x)=1+xM(x)+(xM(x))^2.$$ Using this equation alone, together with the method of Lagrange inversion, we will derive a formula for the $n^\text{th}$ Motzkin number.

Let $f(x)=xM(x)$. The previous equation can be written $$ \frac{f(x)}{1+f(x)+f(x)^2}=x. $$ Now, let $g(x)=\frac x{1+x+x^2}$. The above equation says that $g(f(x))=x$, so $f(x)$ and $g(x)$ are functional inverses of each other, with $f(0)=g(0)=0$. Therefore, we can use the Lagrange inversion formula to extract the coefficient of $f(x)$.

$$ \begin{align} [x^n]f(x) &=\tfrac1n[x^{-1}]g(x)^{-n}, \\&= \tfrac1n [x^{-1}]\;x^{-n}(1+x+x^2)^n, \\&= \tfrac1n [x^{n-1}]\;(1-x^3)^n(1-x)^{-n}, \\&= \frac1n\sum_{k}\binom{n}{k}(-1)^{k}\cdot \binom{-n}{n-1-3k}(-1)^{n-1-3k}, \\&= \frac1n\sum_{k}\binom{n}{k}(-1)^{k}\cdot \binom{2n-2-3k}{n-1-3k}. \end{align} $$ Finally, since $M(x)=xf(x)$, the coefficient of $x^n$ in $M(x)$ is equal to the coefficient of $x^{n+1}$ in $f(x)$. Therefore, letting $M_n=[x^n]M(x)$, we have derived $$ \boxed{M_n=\frac1{n+1}\sum_{k=0}^{\lfloor n/3\rfloor }(-1)^k\binom{n+1}k \binom{2n-3k}{n}.} $$

Related Question