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!)
A356832 Number of permutations p of [n] such that at most one element of {p(1),...,p(i-1)} is between p(i) and p(i+1) for all i < n and n = 0 or p(n) < 3. 2
1, 1, 2, 4, 10, 26, 72, 206, 608, 1834, 5636, 17578, 55516, 177192, 570700, 1852572, 6055080, 19910730, 65823752, 218654100, 729459552, 2443051214, 8210993364, 27685671844, 93625082140, 317470233150, 1079183930828, 3676951654520, 12554734605496, 42952566314236 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = A356692(n,0) = A356692(n,n).
a(n) = 1 + A291683(n).
a(n) >= A102407(n) with equality only for n <= 7.
EXAMPLE
a(0) = 1: (), the empty permutation.
a(1) = 1: 1.
a(2) = 2: 12, 21.
a(3) = 4: 132, 231, 312, 321.
a(4) = 10: 1342, 1432, 2431, 3142, 3412, 3421, 4132, 4231, 4312, 4321.
a(5) = 26: 13542, 14532, 15342, 15432, 24531, 25431, 31542, 35142, 35412, 35421, 41532, 42531, 45132, 45231, 45312, 45321, 51342, 51432, 52431, 53142, 53412, 53421, 54132, 54231, 54312, 54321.
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-> b(0, n):
seq(a(n), n=0..30);
# second Maple program:
b:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
`if`(n=0, 1, add(b(n-1, j), j=k-2..k+1)))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..30);
CROSSREFS
Column k=0 and also main diagonal of A356692.
Sequence in context: A049145 A102407 A358455 * A148097 A148098 A210043
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 30 2022
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 September 17 05:28 EDT 2024. Contains 375985 sequences. (Running on oeis4.)