A000140 Kendall-Mann numbers: the most common number of inversions in a permutation on n letters is floor(n*(n-1)/4); a(n) is the number of permutations with this many inversions.
1, 1, 2, 6, 22, 101, 573, 3836, 29228, 250749, 2409581, 25598186, 296643390, 3727542188, 50626553988, 738680521142, 11501573822788, 190418421447330, 3344822488498265, 62119523114983224, 1214967840930909302, 24965661442811799655, 538134522243713149122
Offset: 1
Examples
From _Joerg Arndt_, Jan 16 2011: (Start) a(4) = 6 because the among the permutations of 4 elements those with 3 inversions are the most frequent and appear 6 times: [inv. table] [permutation] number of inversions 0: [ 0 0 0 ] [ 0 1 2 3 ] 0 1: [ 1 0 0 ] [ 1 0 2 3 ] 1 2: [ 0 1 0 ] [ 0 2 1 3 ] 1 3: [ 1 1 0 ] [ 2 0 1 3 ] 2 4: [ 0 2 0 ] [ 1 2 0 3 ] 2 5: [ 1 2 0 ] [ 2 1 0 3 ] 3 (*) 6: [ 0 0 1 ] [ 0 1 3 2 ] 1 7: [ 1 0 1 ] [ 1 0 3 2 ] 2 8: [ 0 1 1 ] [ 0 3 1 2 ] 2 9: [ 1 1 1 ] [ 3 0 1 2 ] 3 (*) 10: [ 0 2 1 ] [ 1 3 0 2 ] 3 (*) 11: [ 1 2 1 ] [ 3 1 0 2 ] 4 12: [ 0 0 2 ] [ 0 2 3 1 ] 2 13: [ 1 0 2 ] [ 2 0 3 1 ] 3 (*) 14: [ 0 1 2 ] [ 0 3 2 1 ] 3 (*) 15: [ 1 1 2 ] [ 3 0 2 1 ] 4 16: [ 0 2 2 ] [ 2 3 0 1 ] 4 17: [ 1 2 2 ] [ 3 2 0 1 ] 5 18: [ 0 0 3 ] [ 1 2 3 0 ] 3 (*) 19: [ 1 0 3 ] [ 2 1 3 0 ] 4 20: [ 0 1 3 ] [ 1 3 2 0 ] 4 21: [ 1 1 3 ] [ 3 1 2 0 ] 5 22: [ 0 2 3 ] [ 2 3 1 0 ] 5 23: [ 1 2 3 ] [ 3 2 1 0 ] 6 The statistics are reflected by the coefficients of the polynomial (1+x)*(1+x+x^2)*(1+x+x^2+x^3) == x^6 + 3*x^5 + 5*x^4 + 6*x^3 + 5*x^2 + 3*x^1 + 1*x^0 There is 1 permutation (the identity) with 0 inversions, 3 permutations with 1 inversion, 5 with 2 inversions, 6 with 3 inversions (the most frequent, marked with (*) ), 5 with 4 inversions, 3 with 5 inversions, and one with 6 inversions. (End) G.f. = x + x^2 + 2*x^3 + 6*x^4 + 22*x^5 + 101*x^6 + 573*x^7 + 3836*x^8 + ...
References
- F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 241.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- Robert Israel, Robert G. Wilson v and N. J. A. Sloane Table of n, a(n) for n = 1..400 (a(1) to a(61) from Sloane, a(62) to a(350) from Wilson).
- Dorin Andrica and Ovidiu Bagdasar, On some results concerning the polygonal polynomials, Carpathian Journal of Mathematics (2019) Vol. 35, No. 1, 1-11.
- Dominique Foata, Distributions eulériennes et mahoniennes sur le groupe des permutations, pp. 27-49 of M. Aigner, editor, Higher Combinatorics, Reidel, Dordrecht, Holland, 1977.
- Mikhail Gaichenkov, The property of Kendall-Mann numbers, MathOverflow, 2010.
- Richard K. Guy, Letter to N. J. A. Sloane with attachment, Mar 1988.
- A. Waksman, On the complexity of inversions, IEEE Trans. Computers, 19 (1970), 1225-1226.
- Wikipedia, Inversion.
- Wikipedia, q-Pochhammer symbol. - _Paul Muljadi_, Jan 18 2011
- Index entries for "core" sequences.
Programs
-
Magma
/* based on David W. Wilson's formula */ PS
:=PowerSeriesRing(Integers()); [ Max(Coefficients(&*[&+[ x^i: i in [0..j] ]: j in [0..n-1] ])): n in [1..21] ]; // Klaus Brockhaus, Jan 18 2011 -
Maple
f := 1: for n from 0 to 40 do f := f*add(x^i, i=0..n): s := series(f, x, n*(n+1)/2+1): m := max(coeff(s, x, j) $ j=0..n*(n+1)/2): printf(`%d,`,m) od: # James Sellers, Dec 07 2000 [offset is off by 1 - N. J. A. Sloane, May 23 2006] P:= [1]: a[1]:= 1: for n from 2 to 100 do P:= expand(P * add(x^j,j=0..n-1)); a[n]:= max(eval(convert(P,list),x=1)); od: seq(a[i],i=1..100); # Robert Israel, Dec 14 2014
-
Mathematica
f[n_] := Max@ CoefficientList[ Expand@ Product[ Sum[x^i, {i, 0, j}], {j, n-1}], x]; Array[f, 20] Flatten[{1, 1, Table[Coefficient[Expand[Product[Sum[x^k, {k, 0, m-1}], {m, 1, n}]], x^Floor[n*(n-1)/4]], {n, 3, 20}]}] (* Vaclav Kotesovec, May 13 2016 *) Table[SeriesCoefficient[QPochhammer[x, x, n]/(1-x)^n, {x, 0, Floor[n*(n-1)/4]}], {n, 1, 20}] (* Vaclav Kotesovec, May 13 2016 *)
-
PARI
{a(n) = if( n<0, 0, vecmax( Vec( prod(k=1, n, 1 - x^k) / (1 - x)^n)))}; /* Michael Somos, Apr 21 2014 */
-
Python
from math import prod from sympy import Poly from sympy.abc import x def A000140(n): return 1 if n == 1 else max(Poly(prod(sum(x**i for i in range(j+1)) for j in range(n))).all_coeffs()) # Chai Wah Wu, Feb 02 2022
Formula
Largest coefficient of (1)(x+1)(x^2+x+1)...(x^(n-1) + ... + x + 1). - David W. Wilson
The number of terms is given in A000124.
a(n+1)/a(n) = n - 1/2 + O(1/n^{1-epsilon}) as n --> infinity (compare with A008302, A181609, A001147). - Mikhail Gaichenkov, Apr 11 2014
Asymptotics (Mikhail Gaichenkov, 2010): a(n) ~ 6 * n^(n-1) / exp(n). - Vaclav Kotesovec, May 17 2015
Extensions
Edited by N. J. A. Sloane, Mar 05 2011
Comments