%I #7 Oct 31 2013 12:17:32
%S 0,6,128,2500,51840,1176490,29360128,803538792,24000000000,
%T 778122738030,27243640258560,1025115745389164,41273168209215488,
%U 1771037512207031250,80704505322479288320,3892895350053349478480,198189314749641818898432
%N The work performed by a partial function f:{1,...,n}->{1,...,n} is defined to be work(f)=sum(|i-f(i)|,i in dom(f)); a(n) is equal to sum(work(f)) where the sum is over all partial functions f:{1,...,n}->{1,...,n}.
%C If n == -1 (mod 10^k) then 10^(n*k) divides a(n), so 10^9 divides a(9), 10^19 divides a(19),...,10^198 divides a(99), etc. - _Farideh Firoozbakht_, Nov 27 2005
%H James East <a href="http://www.maths.usyd.edu.au/u/pubs/publist/preprints/2005/east-35.html">The Work Performed by a Transformation Semigroup</a>, preprint 2005.
%F (n+1)^n*(n^2-n)/3
%e When n=2 there are 9 partial maps {1,2}->{1,2}: these are (1 1), (2 2), (1 2), (2 1), (1 -), (2 -), (- 1), (- 2) (- -). Adding up the work performed by these maps (from left to right as arranged above) gives a(2)=1+1+0+2+0+1+1+0+0=6.
%t Table[(n + 1)^n*(n^2 - n)/3, {n, 17}] (* _Robert G. Wilson v_ *)
%Y Cf. A111867, A111874, A111903.
%K easy,nonn
%O 1,2
%A _James East_, Nov 23 2005
%E More terms from _Farideh Firoozbakht_ and _Robert G. Wilson v_, Nov 27 2005
|