cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A262166 Number of permutations p of [n] such that the up-down signature of 0,p has nonnegative partial sums with a maximal value <= 4.

Original entry on oeis.org

1, 1, 2, 5, 20, 86, 516, 3135, 25080, 196468, 1964680, 18827225, 225926700, 2559350288, 35830904032, 468385940355, 7494175045680, 111029569712844, 1998532254831192, 33092842524631733, 661856850492634660, 12113055891685809704, 266487229617087813488
Offset: 0

Views

Author

Alois P. Heinz, Sep 13 2015

Keywords

Crossrefs

Column k=4 of A262163.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0 or c>4, 0, `if`(u+o=0,
           x^c, (p-> add(coeff(p, x, i)*x^max(i, c), i=0..4))(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-> (p-> add(coeff(p, x, i), i=0..min(n, 4)))(b(0, n, 0)):
    seq(a(n), n=0..25);
  • Mathematica
    b[u_, o_, c_] := b[u, o, c] = If[c < 0 || c > 4, 0, If[u + o == 0, x^c, Function[p, Sum[Coefficient[p, x, i]*x^Max[i, c], {i, 0, 4}]][Sum[b[u - j, o - 1 + j, c - 1], {j, u}] + Sum[b[u + j - 1, o - j, c + 1], {j, o}]]]];
    a[n_] := Function[p, Sum[Coefficient[p, x, i], {i, 0, Min[n, 4]}]][b[0, n, 0]];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 30 2021, after Alois P. HeInz *)

Formula

a(n) = A262163(n,4).