OFFSET
1,2
COMMENTS
a(n) = number of non-injective functions [k]->[k] for 1<=k<=n.
FORMULA
a(n) = Sum_{k=0..n} (k^k-k!).
EXAMPLE
a(4) = 255 because (1^1-1!)+(2^2-2!)+(3^3-3!)+(4^4-4!) = 255.
MATHEMATICA
Accumulate[Table[n^n-n!, {n, 20}]] (* Harvey P. Dale, Aug 21 2011 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Darrell Minor, Apr 02 2002
STATUS
approved