A242819 Number T(n,k) of permutations of [n] with exactly k occurrences of the consecutive step pattern up, down, down; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-1)/3)), read by rows.
1, 1, 2, 6, 21, 3, 90, 30, 450, 270, 2619, 2322, 99, 17334, 20772, 2214, 129114, 195372, 38394, 1067661, 1958337, 591543, 11259, 9713682, 20933154, 8826246, 443718, 96393726, 238789782, 131367258, 12450834, 1036348587, 2900868876, 1989555210, 297195804, 3052323
Offset: 0
Examples
T(4,1) = 3: (1,4,3,2), (2,4,3,1), (3,4,2,1). Triangle T(n,k) begins: : 0 : 1; : 1 : 1; : 2 : 2; : 3 : 6; : 4 : 21, 3; : 5 : 90, 30; : 6 : 450, 270; : 7 : 2619, 2322, 99; : 8 : 17334, 20772, 2214; : 9 : 129114, 195372, 38394; : 10 : 1067661, 1958337, 591543, 11259; : 11 : 9713682, 20933154, 8826246, 443718;
Links
- Alois P. Heinz, Rows n = 0..120, flattened
Crossrefs
Programs
-
Maple
b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand( add(b(u-j, o+j-1, [1, 3, 1][t])*`if`(t=3, x, 1), j=1..u)+ add(b(u+j-1, o-j, 2), j=1..o))) end: T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)): seq(T(n), n=0..15);
-
Mathematica
b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Expand[Sum[b[u-j, o+j-1, {1, 3, 1}[[t]]]*If[t == 3, x, 1], {j, 1, u}] + Sum[b[u+j-1, o-j, 2], {j, 1, o}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0, 1]]; Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, Feb 10 2015, after Alois P. Heinz *)
Comments