Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #29 Mar 19 2014 15:58:11
%S 1,1,3,2,6,6,2,12,18,10,3,18,42,40,15,3,27,78,110,75,21,4,36,132,240,
%T 240,126,28,4,48,204,460,600,462,196,36,5,60,300,800,1290,1302,812,
%U 288,45,5,75,420,1300,2490,3108,2548,1332,405,55,6,90,570,2000,4440,6594,6692,4608,2070,550,66
%N Triangle read by rows: T(n,k) is the number of inversions in k-compositions of n for n >= 3, 2 <= k <= n-1.
%C The Heibach et al. reference has a table for n <= 14.
%H Alois P. Heinz, <a href="/A189073/b189073.txt">Rows n = 3..143, flattened</a>
%H S. Heubach, A. Knopfmacher, M. E. Mays and A. Munagi, <a href="http://www.calstatela.edu/faculty/sheubac/papers/inversns_in_composns.pdf ">Inversions in Compositions of Integers</a>, to appear in Quaestiones Mathematicae.
%F G.f.: (1-x)*x^3/((1+x)*(1-x-y*x)^3). - _Geoffrey Critzer_, Mar 19 2014
%e Triangle begins:
%e 1;
%e 1, 3;
%e 2, 6, 6;
%e 2, 12, 18, 10;
%e 3, 18, 42, 40, 15;
%e 3, 27, 78, 110, 75, 21;
%e 4, 36, 132, 240, 240, 126, 28;
%e 4, 48, 204, 460, 600, 462, 196, 36;
%e 5, 60, 300, 800, 1290, 1302, 812, 288, 45;
%e 5, 75, 420, 1300, 2490, 3108, 2548, 1332, 405, 55;
%e 6, 90, 570, 2000, 4440, 6594, 6692, 4608, 2070, 550, 66;
%e ...
%e T(5,3) = 6 because we have: 3+1+1, 1+3+1, 1+1+3, 2+2+1, 2+1+2, 1+2+2 having 2,1,0,2,1,0 inversions respectively. - _Geoffrey Critzer_, Mar 19 2014
%p T:= proc(n, k) option remember;
%p if k=2 then floor((n-1)/2)
%p elif k>=n then 0
%p else T(n-1, k) +k/(k-2) *T(n-1, k-1)
%p fi
%p end:
%p seq(seq(T(n, k), k=2..n-1), n=3..13); # _Alois P. Heinz_, Apr 17 2011
%t T[n_, k_] := T[n, k] = Which[k == 2, Floor[(n-1)/2], k >= n, 0, True, T[n-1, k] + k/(k-2)*T[n-1, k-1]]; Table[Table[T[n, k], {k, 2, n-1}], {n, 3, 13}] // Flatten (* _Jean-François Alcover_, Jan 14 2014, after _Alois P. Heinz_ *)
%Y Row sums are A189052. The first column is A004526(n-1). Diagonal is A000217(n-2). Lower diagonal is A002411(n-3). 2nd lower diagonal is A001621(n-4).
%K nonn,tabl
%O 3,3
%A _N. J. A. Sloane_, Apr 16 2011