<s>[INST] expression for$\sum_{k=0}^{n}(k+1)(k+2)$ what is a closed expression for$\sum_{k=0}^{n}(k+1)(k+2)$? the answer says to look at Generating function $a_k=(k+1)(k+2)$ and derive twice $\dfrac{1}{x}=1+x+x^2+...$ so the solution starts: $\sum_{k=0}^{n}(k+1)(k+2)=[\dfrac{1}{(1-x)}.\dfrac{2}{(1-x)^3}]$but isn't $\sum_{k=0}^{\infty}t^k=\dfrac{1}{(1-t)}$? so how the lhs and rhs in  $\sum_{k=0}^{n}(k+1)(k+2)=[\dfrac{1}{(1-x)}.\dfrac{2}{(1-x)^3}]$ are equal?
 [/INST] Hint. You may want to write
$$ \sum_{n=0}^{\infty} \left( \sum_{k=0}^{n} (k+1)(k+2) \right) x^{n} = \frac{2}{(1-x)^{4}}. $$

Here is another solution using the Pascal's triangle:
$$ \sum_{k=0}^{n} (k+1)(k+2) = 2 \sum_{k=0}^{n} \binom{k+2}{2} = 2 \left[ \binom{2}{2} + \cdots + \binom{n+2}{2} \right]. $$
Now we know that $\binom{2}{2} = 1 = \binom{3}{3}$. So by applying the property $\binom{m}{k-1} + \binom{m}{k} = \binom{m+1}{k}$ repeatedly, we observe
\begin{align*}
\binom{2}{2} + \cdots + \binom{n+2}{2}
&= \binom{3}{3} + \binom{3}{2} + \binom{4}{2} + \cdots + \binom{n+2}{2} \\
&= \binom{4}{3} + \binom{4}{2} + \cdots + \binom{n+2}{2} \\
&= \binom{5}{3} + \cdots + \binom{n+2}{2} \\
&\quad \quad \vdots \\
&= \binom{n+2}{3} + \binom{n+2}{2} \\
&= \binom{n+3}{3}.
\end{align*}
So we obtain a special case of Christmas Stocking Theorem:
$$ \sum_{k=0}^{n} (k+1)(k+2) = 2 \sum_{k=0}^{n} \binom{k+2}{2} = 2 \binom{n+3}{3} = \frac{(n+3)(n+2)(n+1)}{3}. $$
</s>