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!)
A262126 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value <= 2. 4
1, 1, 1, 3, 8, 40, 162, 1134, 6128, 55152, 372560, 4098160, 33220512, 431866656, 4084265360, 61263980400, 662157708032, 11256681036544, 136873417800960, 2600594938218240, 35134918875668480, 737833296389038080, 10965215649174414848, 252199959931011541504 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = A262124(n,2).
EXAMPLE
a(0) = 1: the empty permutation.
a(1) = 1: 1.
a(2) = 1: 12.
a(3) = 3: 123, 132, 231.
a(4) = 8: 1243, 1324, 1342, 1423, 2314, 2341, 2413, 3412.
MAPLE
b:= proc(u, o, c) option remember; `if`(c<0 or c>2, 0, `if`(u+o=0, x^c,
(p-> add(coeff(p, x, i)*x^max(i, c), i=0..2))(add(
b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
end:
a:= n-> `if`(n=0, 1, (p-> add(coeff(p, x, i), i=0..2))(
add(b(j-1, n-j, 0), j=1..n))):
seq(a(n), n=0..30);
MATHEMATICA
b[u_, o_, c_] := b[u, o, c] = If[c < 0 || c > 2, 0, If[u + o == 0, x^c, Function[p, Sum[Coefficient[p, x, i]*x^Max[i, c], {i, 0, 2}]][Sum[b[u - j, o - 1 + j, c - 1], {j, u}] + Sum[b[u + j - 1, o - j, c + 1], {j, o}]]]];
a[n_] := If[n == 0, 1, Function[p, Sum[Coefficient[p, x, i], {i, 0, 2}]][Sum[b[j - 1, n - j, 0], {j, n}]]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)
CROSSREFS
Column k=2 of A262124.
Sequence in context: A072687 A353718 A260817 * A110561 A107991 A007175
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Sep 11 2015
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 May 1 03:12 EDT 2024. Contains 372148 sequences. (Running on oeis4.)