A367495
Number of up-down permutations p of [n] such that for all ii+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, 2, 4, 11, 37, 147, 684, 3611, 21345, 139794, 1004293, 7853728, 66413562, 603851552, 5874507617, 60886603188, 669797203196, 7794401498440, 95662364870740, 1234953443995817, 16728449735374081, 237245379727483160, 3515622139828164851
Offset: 0
Keywords
Examples
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..250
- Wikipedia, Permutation
Programs
-
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);