Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #22 Sep 01 2022 04:58:55
%S 1,1,1,2,3,4,19,55,125,245,434,4060,21186,81212,254813,692678,1688555,
%T 3776432,60101767,511650887,3089821383,14824989723,60057570858,
%U 213302293918,681247718668,1992449334436,5409214694961,132273848506202,1692162553490943
%N Number of 1 up, 3 down, 5 up, 7 down, ... permutations of [n].
%H Alois P. Heinz, <a href="/A227941/b227941.txt">Table of n, a(n) for n = 0..300</a>
%e a(2) = 1: 12.
%e a(3) = 2: 132, 231.
%e a(4) = 3: 1432, 2431, 3421.
%e a(5) = 4: 15432, 25431, 35421, 45321.
%e a(6) = 19: 154326, 164325, 165324, 165423, 254316, 264315, 265314, 265413, 354216, 364215, 365214, 365412, 453216, 463215, 465213, 465312, 563214, 564213, 564312.
%e a(7) = 55: 1543267, 1643257, ..., 6753124, 6754123.
%e a(8) = 125: 15432678, 16432578, ..., 78641235, 78651234.
%p b:= proc(u, o, t, k) option remember; `if`(u+o=0, 1, add(`if`(t=2*k-1,
%p b(o-j, u+j-1, 1, k+1), b(u+j-1, o-j, t+1, k)), j=1..o))
%p end:
%p a:= n-> b(0, n, 0, 1):
%p seq(a(n), n=0..35);
%t b[u_, o_, t_, k_] := b[u, o, t, k] = If[u+o == 0, 1, Sum[If[t == 2*k-1, b[o-j, u+j-1, 1, k+1], b[u+j-1, o-j, t+1, k]], {j, 1, o}]];
%t a[n_] := b[0, n, 0, 1];
%t Table[a[n], {n, 0, 35}] (* _Jean-François Alcover_, Sep 01 2022, after _Alois P. Heinz_ *)
%Y Cf. A005408, A229066, A229551, A229892.
%K nonn,eigen
%O 0,4
%A _Alois P. Heinz_, Oct 03 2013