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.

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

This page as a plain text file.
%I A262126 #8 Aug 30 2021 06:35:43
%S A262126 1,1,1,3,8,40,162,1134,6128,55152,372560,4098160,33220512,431866656,
%T A262126 4084265360,61263980400,662157708032,11256681036544,136873417800960,
%U A262126 2600594938218240,35134918875668480,737833296389038080,10965215649174414848,252199959931011541504
%N A262126 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value <= 2.
%H A262126 Alois P. Heinz, <a href="/A262126/b262126.txt">Table of n, a(n) for n = 0..464</a>
%F A262126 a(n) = A262124(n,2).
%e A262126 a(0) = 1: the empty permutation.
%e A262126 a(1) = 1: 1.
%e A262126 a(2) = 1: 12.
%e A262126 a(3) = 3: 123, 132, 231.
%e A262126 a(4) = 8: 1243, 1324, 1342, 1423, 2314, 2341, 2413, 3412.
%p A262126 b:= proc(u, o, c) option remember; `if`(c<0 or c>2, 0, `if`(u+o=0, x^c,
%p A262126       (p-> add(coeff(p, x, i)*x^max(i, c), i=0..2))(add(
%p A262126        b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
%p A262126     end:
%p A262126 a:= n-> `if`(n=0, 1, (p-> add(coeff(p, x, i), i=0..2))(
%p A262126          add(b(j-1, n-j, 0), j=1..n))):
%p A262126 seq(a(n), n=0..30);
%t A262126 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}]]]];
%t A262126 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}]]];
%t A262126 Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Aug 30 2021, after _Alois P. Heinz_ *)
%Y A262126 Column k=2 of A262124.
%K A262126 nonn
%O A262126 0,4
%A A262126 _Alois P. Heinz_, Sep 11 2015