I originally stumbled upon this beast whilst trying to find the number of surjective functions from $[n]=\{ 1,...,n\}$ to $[k]$.
Here is my idea, denote this number $a(n,k)$ hence $a(n,k) =k^n- \#\{{f:[n]\to [k]\; | \; f \; isn't \; surjective}\}$. For every $1\leq m\leq k-1$ we have ${m\choose k}$ ways of choosing a set of $m$ elements from $[k]$ and $a(n,m)$ functions in $\{{f:[n]\to [k]\; | \; f \; isn't \; surjective}\}$ with $|im(f)|=m$ and so:
$a(n,k+1)=(k+1)^n-\sum_{m=1}^k {k+1\choose m}a(n,m)$
From here I tried to use induction to get $a(n,k+1)$ to the form of a polynomial in $a(n,1)$ which is clearly $1$, but had no luck as to finding the polynomial itself.
Solutions to the original problem or to the recurrence relation would by much appreciated.
EDIT: from the inclusion-exclusion prinicple I got the follwing expression for $a(n,k)$ which is:
$a(n,k) = \sum_{m=0}^k (-1)^m{k\choose m}(k-m)^n$
and plugging it into $a(n,k+1)=(k+1)^n-\sum_{m=1}^k {k+1\choose m}a(n,m)$ yeilds:
$a(n,k+1)=(k+1)^n-\sum_{m=1}^k{\sum_{i=0}^m {k+1 \choose k+1-m,i,m-i}(m-i)^n}$
which, to be honest, looks terrible.
My original question still stands, what is the closed-form expression (if there even is one) for this monster double sum?