login
A367495
Number of up-down permutations p of [n] such that for all i<n-1 the number of elements p(j) between p(i) and p(i+1) for j>i+1 differs from the number of elements p(k) between p(i+1) and p(i+2) for k>i+2.
1
1, 1, 1, 1, 2, 4, 11, 37, 147, 684, 3611, 21345, 139794, 1004293, 7853728, 66413562, 603851552, 5874507617, 60886603188, 669797203196, 7794401498440, 95662364870740, 1234953443995817, 16728449735374081, 237245379727483160, 3515622139828164851
OFFSET
0,5
LINKS
Wikipedia, Permutation
EXAMPLE
a(0) = 1: (), the empty permutation.
a(1) = 1: 1.
a(2) = 1: 12.
a(3) = 1: 132.
a(4) = 2: 1423, 3412.
a(5) = 4: 13254, 15243, 35142, 45132.
a(6) = 11: 132645, 142635, 162534, 164523, 264513, 341625, 361524, 364512, 461523, 561423, 563412.
MAPLE
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
add(`if`(j=t, 0, b(o-1+j, u-j, j)), j=1..u))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..30);
CROSSREFS
Sequence in context: A253927 A281481 A138301 * A173939 A328433 A118182
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 20 2023
STATUS
approved