OFFSET
0,3
COMMENTS
a(n)/n^n is the expected value for the cardinality of the image set of a function that takes [n] to [n].
a(n)/n^(n+1) is the probability that any particular element of [n] will be in the range of a function f : [n] to [n].
FORMULA
a(n) = n*(n^n - (n-1)^n).
a(n) = Sum_{i=1..n} S(n,i)*i!*binomial(n,i)*i where S(n,i) is the Stirling number of the second kind.
a(n) = Sum_{k=1..n} A090657(n,k)*k.
Limit_{n->infinity} a(n)/n^(n+1) = (e-1)/e. - Thomas Dybdahl Ahle, Apr 24 2011
EXAMPLE
a(2) = 6 because the image sets of the functions from [2] to [2] are {1},{2},{1,2},{1,2}.
MATHEMATICA
Table[Sum[StirlingS2[n, i] i! Binomial[n, i] i, {i, 1, n}], {n, 0, 20}] (* Geoffrey Critzer, Mar 17 2009 *)
PROG
(Magma) [n*(n^n-(n-1)^n): n in [0..20]]; // Vincenzo Librandi, Jul 23 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Nov 27 2008
EXTENSIONS
More terms from Geoffrey Critzer, Mar 17 2009
STATUS
approved