I was trying to find the sum of the following series: $\sum_{r=1}^n {n\choose r}r^{n-r}.$
Actually, this series came out as the answer to the question : Find the number of functions $f(n)$ on set $A,$ where $A = \{1,2,...,n\},$ such that $f(f(n)) = f(n)$ for all $n \in A. $
I wondered whether I could give the answer to the question as a closed form expression, but I have no idea how to convert the series into a closed form expression. Does this series even have a closed form expression? Can anyone please help?