Calculating ...5(5+4(4+3(3+2(2+1(1))))) I've been puzzling over this question for a while now, and I've finally decided to turn to the StackExchange community in order to get an answer.  
How would one determine the value of the expression ...5(5+4(4+3(3+2(2+1(1)))))) to n, assuming that in this case n = 5?  
Cheers!
 A: Following Winther and ctst suggestions in the comments, by setting
$$ a_1=1,\quad a_{n+1}=(n+1)(n+1+a_n),\quad b_n = \frac{a_n}{n!}\tag{0}$$
we get $b_1=1$ and $b_n-b_{n-1}=\frac{n^2}{n!}=\frac{n}{(n-1)!}$, so:
$$ a_n = n!\sum_{k=1}^{n}\frac{(k-1)+1}{(k-1)!}=n!\left(\sum_{k=0}^{n-1}\frac{1}{k!}+\sum_{k=0}^{n-2}\frac{1}{k!}\right)=n!\left(2\sum_{k=0}^{n-1}\frac{1}{k!}-\frac{1}{(n-1)!}\right).\tag{1} $$
A: This can be written as:
$$5\cdot 5 + 5\cdot 4\cdot 4 + 5\cdot 4\cdot 3\cdot3 + 5\cdot 4\cdot 3\cdot 2\cdot 2+5!\cdot 1\\
=\frac{5!}{4!}\cdot 5 + \frac{5!}{3!}\cdot 4 + \frac{5!}{2!}\cdot 3 + \frac{5!}{1!}\cdot 2+\frac{5!}{0!}\cdot 1$$
Then the general formula is:
$$\sum_{k=0}^{n-1}\frac{n!}{k!}(k+1) = n!\sum_{k=0}^{n-1}\frac{k+1}{k!}$$
This likely does not have a closed form, but we can say that:
$$\sum_{k=0}^{n-1}\frac{k+1}{k!} = \frac{1}{(n-1)!}+2\sum_{k=0}^{n-2}\frac{1}{k!} $$
So:
$$\lim_{n\to\infty}\sum_{k=1}^{n-1}\frac{k+1}{k!}=2e$$
A: Let's start by evaluating the series at small $n$:
$$S_1=1^2$$
$$S_2=1^2(2) + 2^2$$
$$S_3=1^2(2)(3) + 2^2(3) + 3^2$$
$$S_4=1^2(2)(3)(4) + 2^2(3)(4) + 3^2(4) + 4^2$$
And generally:
$$S_n=1\frac{n!}{0!}+2\frac{n!}{1!}+3\frac{n!}{2!}+...+(n-1)\frac{n!}{(n-2)!}+n\frac{n!}{(n-1)!}$$
$$=\sum_{k=1}^{n} {k\frac{n!}{(k-1)!}}=n!\sum_{k=1}^{n} {\frac{k}{(k-1)!}}=n!\sum_{k=1}^{n} {\frac{1+(k-1)}{(k-1)!}}$$
$$=n!\bigg(\sum_{k=1}^{n} {\frac{1}{(k-1)!}}+\sum_{k=1}^{n}\frac{k-1}{(k-1)!}\bigg)$$
$$=n!\bigg(\sum_{k=1}^{n} {\frac{1}{(k-1)!}}+\sum_{k=2}^{n}\frac{1}{(k-2)!}\bigg)$$
Now we must bring in the identity:
$$\sum_{k=1}^{n}{\frac{1}{k!}}=\frac{e\Gamma(n+1,1)}{n!}-1$$
Where $\Gamma(a,b)$ is the incomplete upper gamma function. In this case it can be calculated with the recurrence relation of:  $\Gamma(n+1,1)=n\Gamma(n,1)+\frac{1}{e}$
Note:
$$\sum_{k=1}^{n} {\frac{1}{(k-1)!}}=\sum_{k=0}^{n-1} {\frac{1}{k!}}=1-\frac{1}{n!}+\sum_{k=1}^{n} {\frac{1}{k!}}=\frac{e\Gamma(n+1,1)-1}{n!}$$
$$\sum_{k=2}^{n} {\frac{1}{(k-2)!}}=\sum_{k=0}^{n-2} {\frac{1}{k!}}=1-\frac{1}{n!}-\frac{1}{(n-1)!}+\sum_{k=1}^{n} {\frac{1}{k!}}=\frac{e\Gamma(n+1,1)-n-1}{n!}$$
Substitute:
$$S_n=n!\bigg(\frac{e\Gamma(n+1,1)-1}{n!}+\frac{e\Gamma(n+1,1)-n-1}{n!}\bigg)$$
$$=2e\Gamma(n+1,1)-n-2$$
$$=n(2e\Gamma(n,1)-1)$$
Another evaluation of the upper incomplete gamma function (https://arxiv.org/pdf/math-ph/0501019.pdf)
$$\Gamma(n,1)=\frac{1}{e}(1+(n-1)(1+(n-2)(1+(n-3)(1+(n-4)(...)))))$$
This yields:
$$S_n=n(1+2(n-1)(1+(n-2)(1+(n-3)(1+(n-4)(...)))))$$
Which isn't really any better than what you started with. There don't seem to be any expressions that can be computed in $O(1)$ time for this sum.
