OFFSET
4,1
COMMENTS
An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 4..3365
EXAMPLE
a(4) = 5: 4123, 4132, 4213, 4231, 4321.
a(5) = 14: 41235, 41325, 41352, 41523, 41532, 42135, 42315, 42351, 42513, 42531, 43215, 43251, 43521, 45321.
a(6) = 36: 412356, 413256, 413526, 413562, 413625, 413652, 415236, 415263, 415326, 415362, 415632, 421356, 423156, 423516, 423561, 425136, 425163, 425316, 425361, 425631, 432156, 432516, 432561, 435216, 435261, 435621, 453216, 453261, 453621, 456321, 463125, 463152, 463215, 463251, 463521, 465321.
MAPLE
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
add(b(u-j, o+j-1, j), j=1..min(t, u))+
add(b(u+j-1, o-j, j), j=1..min(t, o)))
end:
a:= n-> b(0, n, 4)-b(0, n, 3):
seq(a(n), n=4..50);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 10 2017
STATUS
approved