OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..300
James East, The Work Performed by a Transformation Semigroup, preprint 2005.
FORMULA
a(n) = n^n*(n^2-1) / 3. - Franklin T. Adams-Watters, Dec 14 2006
EXAMPLE
When n=2 there are 4 maps {1,2}->{1,2}. these are (1 1), (2 2), (1 2), (2 1), where we show the map f:{1,2}->{1,2} as (f(1) f(2)). Adding up the work performed by these maps (from left to right as arranged above) gives a(2)=1+1+0+2=4.
MATHEMATICA
Table[n^n (n^2-1)/3, {n, 20}] (* Harvey P. Dale, Sep 24 2011 *)
PROG
(Magma) [n^n*(n^2-1) / 3: n in [1..20]]; // Vincenzo Librandi, Sep 25 2011
CROSSREFS
KEYWORD
easy,nonn,nice
AUTHOR
James East, Nov 23 2005
EXTENSIONS
More terms from Franklin T. Adams-Watters, Dec 14 2006
STATUS
approved