How to find the sum $\sum\limits_{k=1}^n (k^2+k+1)k!$?

How to find the sum $$\sum^n_{k=1} (k^2+k+1)k!$$

What I tried as follows :

$$\sum^n_{k=1} (k^2+k+1)k!$$

=$$\sum^n_{k=1} (k^2)k!+ \sum^n_{k=1} (k)k! + \sum^n_{k=1} (1)k!$$

Now we can write $\sum^n_{k=1} (k^2) $ as $$\frac{n(n+1)(2n+1)}{6}$$ but what to do with $k!$ please guide thanks.......


Solution 1:

Given expression is the same as $$\sum_{k=1}^n ((k+1)^2-k)k!=\sum_{k=1}^n(k+1)(k+1)!-\sum_{k=1}^nkk!\\ =\sum_{k=2}^{n+1}kk!-\sum_{k=1}^nkk!=(n+1)(n+1)!-1!1=(n+1)!(n+1)-1$$

Solution 2:

HINT:

$$(k^2+k+1)k!= (k+1)(k+2) k!+A (k+1)k!+B k!=(k+2)!+A (k+1)!+B k!$$

$$\implies k^2+k+1=(k+1)(k+2)+A(k+1)+B=k^2+k(3+A)+2+A+B $$

Equating the coefficients of $x,A+3=1\implies A=-2$

Equating the constant terms, $A+B+2=1\implies B=-1-A=-1-(-2)=1$

So, $$(k^2+k+1)k!= (k+2)!-2(k+1)!+ k!=(k+2)!-(k+1)!-\{(k+1)!-k!\}$$

Can you recognize the telescopic series?