login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A111868 The work performed by a function f:{1,...,n} -> {1,...,n} is defined to be work(f) = Sum_{i=1..n} |i - f(i)|; a(n) is equal to sum(work(f)) where the sum is over all functions f:{1,...,n}->{1,...,n}. 1
0, 4, 72, 1280, 25000, 544320, 13176688, 352321536, 10331213040, 330000000000, 11412466824440, 425000788033536, 16961005969166168, 722280443661271040, 32696077148437500000, 1567973246265311887360, 79415065141088329360992 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
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
Sequence in context: A263219 A358295 A100521 * A060645 A363987 A203073
KEYWORD
easy,nonn,nice
AUTHOR
James East, Nov 23 2005
EXTENSIONS
More terms from Franklin T. Adams-Watters, Dec 14 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 26 01:30 EST 2024. Contains 370335 sequences. (Running on oeis4.)