%I M1477 N0583 #39 Feb 22 2024 20:06:03
%S 1,2,5,15,49,169,602,2191,8095,30239,113906,431886,1646177,6301715,
%T 24210652,93299841,360490592,1396030396,5417028610,21056764914,
%U 81978913225,319610939055,1247641114021,4875896455975,19075294462185,74696636715792,292758662041150
%N Number of permutations of (1,...,n) having n-2 inversions (n>=2).
%C Sequence is a diagonal of the triangle A008302 (number of permutations of (1,...,n) with k inversions; see Table 1 of the Margolius reference). - _Emeric Deutsch_, Aug 02 2014
%D F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 241.
%D S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 5.14., p.356.
%D E. Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 96.
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H G. C. Greubel, <a href="/A001892/b001892.txt">Table of n, a(n) for n = 2..1000</a>
%H R. K. Guy, <a href="/A000707/a000707_2.pdf">Letter to N. J. A. Sloane with attachment, Mar 1988</a>
%H B. H. Margolius, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL4/MARGOLIUS/inversions.html">Permutations with inversions</a>, J. Integ. Seqs. Vol. 4 (2001), #01.2.4.
%H R. H. Moritz and R. C. Williams, <a href="http://www.jstor.org/stable/2690326">A coin-tossing problem and some related combinatorics</a>, Math. Mag., 61 (1988), 24-29.
%H E. Netto, <a href="/A000707/a000707_1.pdf">Lehrbuch der Combinatorik</a>, Chapter 4, annotated scanned copy of pages 92-99 only.
%F a(n) = 2^(2*n-3)/sqrt(Pi*n)*Q*(1+O(n^{-1})), where Q is a digital search tree constant, Q = 0.288788095... (see A048651). - corrected by _Vaclav Kotesovec_, Mar 16 2014
%e a(4)=5 because we have 1342, 1423, 2143, 2314, and 3124.
%p f := (x,n)->product((1-x^j)/(1-x),j=1..n); seq(coeff(series(f(x,n),x,n+2),x,n-2), n=2..40);
%t Table[SeriesCoefficient[Product[(1-x^j)/(1-x),{j,1,n}],{x,0,n-2}],{n,2,25}] (* _Vaclav Kotesovec_, Mar 16 2014 *)
%Y Cf. A008302, A048651.
%K nonn
%O 2,2
%A _N. J. A. Sloane_, _R. K. Guy_
%E More terms, Maple code, asymptotic formula from Barbara Haas Margolius (margolius(AT)math.csuohio.edu), May 31 2001
%E Definition clarified by _Emeric Deutsch_, Aug 02 2014