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.

A304001 Number of permutations of [n] whose up-down signature has a nonnegative total sum.

This page as a plain text file.
%I A304001 #19 Mar 26 2021 12:36:43
%S A304001 1,1,1,5,12,93,360,3728,20160,259535,1814400,27820524,239500800,
%T A304001 4251096402,43589145600,877606592736,10461394944000,235288904377275,
%U A304001 3201186852864000,79476406782222500,1216451004088320000,33020655481590446318,562000363888803840000
%N A304001 Number of permutations of [n] whose up-down signature has a nonnegative total sum.
%C A304001 The up-down signature has (+1) for each ascent and (-1) for each descent.
%H A304001 Alois P. Heinz, <a href="/A304001/b304001.txt">Table of n, a(n) for n = 0..450</a>
%p A304001 b:= proc(u, o, t) option remember; (n->
%p A304001      `if`(t>=n, n!, `if`(t<-n, 0,
%p A304001       add(b(u-j, o+j-1, t-1), j=1..u)+
%p A304001       add(b(u+j-1, o-j, t+1), j=1..o))))(u+o)
%p A304001     end:
%p A304001 a:= n-> `if`(n=0, 1, add(b(j-1, n-j, 0), j=1..n)):
%p A304001 seq(a(n), n=0..25);
%p A304001 # second Maple program:
%p A304001 a:= n-> `if`(irem(n, 2, 'r')=0, ceil(n!/2),
%p A304001          add(combinat[eulerian1](n, j), j=0..r)):
%p A304001 seq(a(n), n=0..25);
%t A304001 Eulerian1[n_, k_] := If[k == 0, 1, If[n == 0, 0, Sum[(-1)^j (k - j + 1)^n Binomial[n + 1, j], {j, 0, k + 1}]]];
%t A304001 a[n_] := Module[{r, m}, {r, m} = QuotientRemainder[n, 2]; If[m == 0, Ceiling[n!/2], Sum[Eulerian1[n, j], {j, 0, r}]]];
%t A304001 a /@ Range[0, 25] (* _Jean-François Alcover_, Mar 26 2021, after 2nd Maple program *)
%Y A304001 Bisections give: A002674 (even part), A179457(2n+1,n+1) (odd part).
%Y A304001 Cf. A000246 (for nonnegative partial sums), A006551 (total sums are 0 or 1), A008292, A303287.
%K A304001 nonn
%O A304001 0,4
%A A304001 _Alois P. Heinz_, May 04 2018