A214086 Number of involutions of length n having exactly n inversions.
1, 0, 0, 1, 1, 2, 10, 17, 39, 119, 254, 613, 1623, 3791, 9281, 23469, 56823, 140035, 349167, 857868, 2122297, 5274213, 13044870, 32357838, 80421284, 199613489, 496144310, 1234420850, 3070773600, 7644879181, 19044266176, 47450853932, 118290412077, 295019269801
Offset: 0
Keywords
Examples
a(0) = 1: (), the empty involution. a(3) = 1: (3,2,1); inversions are (3,2), (3,1), (2,1). a(4) = 1: (3,4,1,2); inversions are (3,1), (3,2), (4,1), (4,2). a(5) = 2: (1,5,3,4,2), (4,2,3,1,5). a(6) = 10: (1,2,6,5,4,3), (1,4,6,2,5,3), (1,5,3,6,2,4), (1,5,4,3,2,6), (2,1,6,4,5,3), (3,2,1,6,5,4), (3,5,1,4,2,6), (4,2,3,1,6,5), (4,2,5,1,3,6), (4,3,2,1,5,6).
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..2000
- Wikipedia, Inversion
- Wikipedia, Involution
Programs
-
Maple
T:= proc(n, k) option remember; `if`(n<0 or k<0, 0, `if`(k=0, 1, T(n-1, k) + add(T(n-2, k-2*(n-j)+1), j=1..n-1))) end: a:= n-> T(n$2): seq(a(n), n=0..50);
-
Mathematica
Needs["Combinatorica`"]; Table[Count[Map[Inversions,Involutions[n]],n],{n,0,12}] (* Second program: *) T[n_, k_] := T[n, k] = If[n < 0 || k < 0, 0, If[k == 0, 1, T[n-1, k] + Sum[T[n-2, k-2*(n-j)+1], {j, 1, n-1}]]]; a[n_] := T[n, n]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 04 2023, after Maple code *)
Formula
a(n) = T(n,n) with T(n,k) = T(n-1,k) + Sum_{j=1..n-1} T(n-2,k-2*(n-j)+1) for n>=0, k>0; T(n,k) = 0 for n<0 or k<0; T(n,0) = 1 for n>=0.
a(n) ~ c * d^n / sqrt(n), where d = 2.529010713480526199368... is the root of the equation 4 - 23*d - 36*d^2 - 8*d^3 + 4*d^5 = 0, c = 0.08933570507578447270759... . - Vaclav Kotesovec, Sep 07 2014