OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..250
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
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 20 2023
STATUS
approved