%I #12 Oct 27 2017 07:43:50
%S 1,1,2,4,9,22,59,172,547,1886,7047,28360,122675,567210,2796999,
%T 14641044,81191947,475148678,2929442263,18965690560,128754649699,
%U 914056305794,6777666961735,52367331911180,421188392986843,3519168714308702,30519733808467031
%N Number of ascent sequences of length n with alternating ascents and descents (unaffected by level steps).
%H Alois P. Heinz, <a href="/A294281/b294281.txt">Table of n, a(n) for n = 0..550</a>
%F a(n) = Sum_{j=0..n} binomial(n-1,j) * A099960(n-j).
%e a(3) = 4: 000, 001, 010, 011.
%e a(4) = 9: 0000, 0001, 0010, 0011, 0100, 0101, 0102, 0110, 0111.
%e a(5) = 22: 00000, 00001, 00010, 00011, 00100, 00101, 00102, 00110, 00111, 01000, 01001, 01002, 01010, 01011, 01020, 01021, 01022, 01100, 01101, 01102, 01110, 01111.
%p b:= proc(n, i, t, u) option remember; `if`(n<1, 1, add(
%p b(n-1, j, t+`if`(j>i, 1, 0), `if`(i=j, u, 1-u)),
%p j=`if`(u=0, i..t+1, 0..i)))
%p end:
%p a:= n-> b(n-1, 0$3):
%p seq(a(n), n=0..30);
%Y Cf. A022493, A099960.
%K nonn
%O 0,3
%A _Alois P. Heinz_, Oct 26 2017