A266947 Number of permutations p of [2n] such that the up-down signature of 0,p has nonnegative partial sums with a maximal value of n.
1, 1, 11, 130, 4734, 127538, 11174035, 554432537, 92953037066, 7392808621010, 2037044419366071, 237281497432517293, 97619260603080874874, 15664643539583989506694, 9013597510492035989870645, 1906222253095637349478735538, 1463288823474568248157186058298
Offset: 0
Keywords
Examples
a(2) = 11: 1324, 1423, 1432, 2134, 2314, 2413, 2431, 3124, 3412, 3421, 4123.
Links
- Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 0..168 (terms 0..100 from Alois P. Heinz)
Crossrefs
Cf. A258829.
Programs
-
Maple
b:= proc(u, o, c, k) option remember; `if`(c<0 or c>k, 0, `if`(u+o=0, 1, add(b(u-j, o-1+j, c+1, k), j=1..u)+ add(b(u+j-1, o-j, c-1, k), j=1..o))) end: a:= n-> b(2*n, 0$2, n)-b(2*n, 0$2, n-1): seq(a(n), n=0..20);
-
Mathematica
b[u_, o_, c_, k_] := b[u, o, c, k] = If[c < 0 || c > k, 0, If[u + o == 0, 1, Sum[b[u - j, o - 1 + j, c + 1, k], {j, 1, u}] + Sum[b[u + j - 1, o - j, c - 1, k], {j, 1, o}]]]; a[n_] := b[2n, 0, 0, n] - b[2n, 0, 0, n - 1]; a /@ Range[0, 20] (* Jean-François Alcover, Dec 29 2020, after Alois P. Heinz *)
Formula
a(n) = A258829(2n,n).