OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..400
F. C. S. Brown, T. M. A. Fink and K. Willbrand, On arithmetic and asymptotic properties of up-down numbers, arXiv:math/0607763 [math.CO], 2006.
FORMULA
E.g.f.: 1 + 1/2 [z/(1-z) + tanh(z) ].
If n is even, a(n) = (n)!/2 (A002674), if n is odd, a(n) = (n)! * (1 + (-1)^((n-1)/2) * A002430((n+1)/2) / A036279((n+1)/2)) / 2. - Michel Marcus, Dec 09 2012
Conjecture: a(n) = Sum_{k = 0..n} Sum_{j = 0..k} (-1)^(n+j)*binomial(n,k-j)*j^n. - Peter Bala, Jan 22 2020
MAPLE
b:= proc(u, o, t) option remember; `if`(u+o=0, t,
add(b(u-j, o+j-1, t), j=1..u)+
add(b(u+j-1, o-j, 1-t), j=1..o))
end:
a:= n-> b(n, 0, 1):
seq(a(n), n=0..25); # Alois P. Heinz, Sep 29 2015
MATHEMATICA
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, t, Sum[b[u - j, o + j - 1, t], {j, 1, u}] + Sum[b[u + j - 1, o - j, 1 - t], {j, 1, o}]];
a[n_] := b[n, 0, 1];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jul 25 2017, after Alois P. Heinz *)
PROG
(PARI) x='x+O('x^99); Vec(serlaplace((x/(1-x)+tanh(x))/2+1)) \\ Altug Alkan, Jul 25 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, May 09 2007
EXTENSIONS
More terms from Alois P. Heinz, Sep 29 2015
STATUS
approved