login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
a(n) = Sum_{k=0..n-1} A356692(n-1,k) for n >= 1. - Alois P. Heinz, Aug 28 2022
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
Sequence in context: A150132 A150133 A244783 * A192658 A049141 A049129
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 03 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 23:15 EDT 2024. Contains 371798 sequences. (Running on oeis4.)