OFFSET
0,4
COMMENTS
All terms are odd.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..494
Wikipedia, Partition of a set
FORMULA
For n>=1, a(n) = Sum_{m=0..n} Sum_{k=1..m+1} (-1)^(m+k+1) * S(m,k-1) * (k-1)! * S(n-m,k) * k! = Sum_{m=0..n} Sum_{k=1..m+1} (-1)^(m+k+1) * A019538(m,k-1) * A019538(n-m,k). - Max Alekseyev, Sep 28 2021
G.f.: 1 + Sum_{k >= 1} (-1)^(k-1) / binomial(-1/x-1,k-1) / binomial(1/x-1,k). - Max Alekseyev, Sep 23 2021
EXAMPLE
a(3) = 3: 123, 12|3, 3|12.
a(4) = 5: 1234, 124|3, 3|124, 12|34, 34|12.
MAPLE
b:= proc(n, m, t) option remember; `if`(n=0, m!,
add(b(n-1, max(m, j), 1-t), j=1..m+1-t))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..30);
MATHEMATICA
b[n_, m_, t_]:=b[n, m, t]=If[n==0, m!, Sum[b[n - 1, Max[m, j], 1 - t], {j, m + 1 - t}]]; Table[b[n, 0, 0], {n, 0, 50}] (* Indranil Ghosh, Jul 30 2017 *)
PROG
(PARI) { A290384(n) = (n==0) + sum(m=0, n, sum(k=1, m+1, stirling(m, k-1, 2)*(k-1)! * stirling(n-m, k, 2)*k! * (-1)^(m+k+1))); } \\ Max Alekseyev, Sep 28 2021
(PARI) { A290384(n) = polcoef(1 + sum(k=1, n, (-1)^(k-1) / binomial(-1/x-1, k-1) / binomial(1/x-1, k) + O(x^(n+1)) ), n); } \\ Max Alekseyev, Sep 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 28 2017
STATUS
approved