OFFSET
0,5
FORMULA
a(n) = [x^(floor(n/2)] F(n, x), the middle coefficient of the Fubini polynomial.
a(n) = Sum_{k=0..n/2} (-1)^k*binomial((2*n - 1)/4 + (-1)^n/4, k)*((2*n - 1)/4 + (-1)^n/4 - k)^n.
MAPLE
a := n -> add((-1)^k*binomial((2*n-1)/4 + (-1)^n/4, k)*((2*n-1)/4 + (-1)^n/4 - k)^n, k = 0..n/2):
# Alternative, via Fubini recurrence:
F := proc(n) option remember; if n = 0 then return 1 fi;
expand(add(binomial(n, k)*F(n - k)*x, k = 1..n)) end:
a := n -> coeff(F(n), x, iquo(n, 2));
seq(a(n), n = 0..22);
MATHEMATICA
a[n_] := StirlingS2[n, Floor[n/2]] * Floor[n/2]!; Array[a, 23, 0] (* Amiram Eldar, May 22 2021 *)
PROG
(SageMath)
def a(n): return stirling_number2(n, n//2) * factorial(n//2)
print([a(n) for n in range(23)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, May 21 2021
STATUS
approved