login
A276313
Number of weak up-down sequences of length n and values in {1,2,...,n}.
3
1, 1, 3, 14, 85, 671, 6405, 72302, 940005, 13846117, 227837533, 4142793511, 82488063476, 1785049505682, 41715243815059, 1046997553798894, 28089178205661221, 802173732190546289, 24296253228394108980, 777918130180655893150, 26253270588637259772768
OFFSET
0,3
LINKS
FORMULA
a(n) ~ exp(1/2) * 2^(n+2) * n^n / Pi^(n+1). - Vaclav Kotesovec, Aug 30 2016
EXAMPLE
a(0) = 1: the empty sequence.
a(1) = 1: 1.
a(2) = 3: 11, 12, 22.
a(3) = 14: 111, 121, 122, 131, 132, 133, 221, 222, 231, 232, 233, 331, 332, 333.
a(4) = 85: 1111, 1112, 1113, 1114, 1211, ..., 4423, 4424, 4433, 4434, 4444.
MAPLE
b:= proc(n, k, t) option remember; `if`(n=0, 1,
add(b(n-1, k, k-j), j=1..t))
end:
a:= n-> b(n, n+1, n):
seq(a(n), n=0..25);
MATHEMATICA
b[n_, k_, t_] := b[n, k, t] = If[n==0, 1, Sum[b[n-1, k, k-j], {j, 1, t}]];
a[n_] := b[n, n+1, n];
Table[a[n], {n, 0, 25}](* Jean-François Alcover, May 18 2017, translated from Maple *)
CROSSREFS
A diagonal of A050446, A050447.
Cf. A276312.
Sequence in context: A331615 A317060 A308940 * A074520 A127715 A307440
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 29 2016
STATUS
approved