A122843 Triangle read by rows: T(n,k) = the number of ascending runs of length k in the permutations of [n] for k <= n.
1, 2, 1, 7, 4, 1, 32, 21, 6, 1, 180, 130, 41, 8, 1, 1200, 930, 312, 67, 10, 1, 9240, 7560, 2646, 602, 99, 12, 1, 80640, 68880, 24864, 5880, 1024, 137, 14, 1, 786240, 695520, 257040, 62496, 11304, 1602, 181, 16, 1, 8467200, 7711200, 2903040, 720720, 133920, 19710, 2360, 231, 18, 1
Offset: 1
Examples
T(3,2) = 4: There are 4 ascending runs of length 2 in the permutations of [3], namely 13 in 132 and in 213, 23 in 231, 12 in 312. Triangle begins: 1; 2, 1; 7, 4, 1; 32, 21, 6, 1; 180, 130, 41, 8, 1; ...
References
- C. M. Grinstead and J. L. Snell, Introduction to Probability, American Mathematical Society, 1997, pp.120-131.
- Donald E. Knuth. The Art of Computer Programming. Vol. 2. Addison-Wesley, Reading, MA, 1998. Seminumerical algorithms, Third edition, Section 3.3.2, p.67.
Links
- Alois P. Heinz, Rows n = 1..141, flattened
- Persi Diaconis, Mathematical developments from the analysis of riffle shuffling, p.4.
- Francis Edward Su, Rising Sequences in Card Shuffling
Crossrefs
Programs
-
Maple
T:= (n, k)-> `if`(n=k, 1, n!/(k+1)!*(k*(n-k+1)+1 -((k+1)*(n-k)+1)/(k+2))): seq(seq(T(n,k), k=1..n), n=1..10); # Alois P. Heinz, Sep 11 2013
-
Mathematica
Table[n!((n(k(k+1)-1)-k(k-2)(k+2)+1))/(k+2)!+Floor[k/n]1/(k(k+3)+2),{n,1,10},{k,1,n}]//TableForm (* Harlan J. Brothers, Jul 23 2008 *)
Formula
T(n,k) = n!(n(k(k+1)-1) - k(k-2)(k+2) + 1)/(k+2)! for 0 < k < n; T(n,n) = 1; T(n,k) = A122844(n,k) - A122844(n,k+1).
T(n,k) = A008304(n,k) for k > n/2. - Alois P. Heinz, Oct 17 2013
Comments