|
|
A216837
|
|
Number of permutations p of {1,...,n} such that at most one element of {p(1),...,p(i-1)} is between p(i) and p(i+1) for all i from 1 to n-1.
|
|
14
|
|
|
1, 1, 2, 6, 20, 72, 268, 1020, 3936, 15332, 60112, 236780, 935848, 3708236, 14721912, 58533264, 232991656, 928261480, 3700935760, 14763921580, 58924038816, 235258847064, 939576469152, 3753419774180, 14997257109992, 59933657096280, 239547378220840
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
a(n) ~ c * 4^n, where c = 0.052940679853652794231561081876002147090052503777... - Vaclav Kotesovec, Feb 23 2014
|
|
EXAMPLE
|
a(4) = 20 = 4! - 4, because 4 permutations of {1,...,4} do not satisfy the condition: 2314, 2341, 3214, 3241.
|
|
MAPLE
|
b:= proc(u, o) option remember; `if`(u+o=0, 1,
add(b(sort([o-j, u+j-1])[]), j=1..min(2, o))+
add(b(sort([u-j, o+j-1])[]), j=1..min(2, u)))
end:
a:= n-> `if`(n=0, 1, add(b(sort([j-1, n-j])[]), j=1..n)):
seq(a(n), n=0..35);
|
|
MATHEMATICA
|
b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[Sequence @@ Sort[{o-j, u+j-1}]], {j, 1, Min[2, o]}] + Sum[b[Sequence @@ Sort[{u-j, o+j-1}]], {j, 1, Min[2, u]}]]; a[n_] := If[n == 0, 1, Sum[b[Sequence @@ Sort[{j-1, n-j}]], {j, 1, n}]]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Feb 05 2015, after Alois P. Heinz *)
|
|
CROSSREFS
|
Cf. A174700, A174701, A174702, A174703, A174704, A174705, A174706, A174707, A174708, A185030, A356692.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|