OFFSET
0,4
COMMENTS
a(n) is the number of ordered set partitions of an n-set into 3 sets such that the first and second sets contain at least one element and the third set contains either one or two elements.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (9,-33,63,-66,36,-8).
FORMULA
a(n) = n*2^(n-1) + binomial(n,2)*(2^(n-2)-2) - 2*n, n >= 3, a(n) = 0 otherwise.
EXAMPLE
a(5)=130 since the set partitions are the following:
20 of the form {1,2,3}, {4}, {5};
20 of the form {1}, {2,3,4}, {5};
30 of the form {1,2}, {3,4}, {5};
30 of the form {1,2}, {3}, {4,5};
30 of the form {1}, {2,3}, {4,5}.
MATHEMATICA
A360588[n_] := If[n <= 2, 0, 2^(n - 3)*n*(n + 3) - n*(n + 1)];
Array[A360588, 35, 0] (* Paolo Xausa, Jun 25 2026 *)
PROG
(PARI) a(n) = if (n>=3, n*2^(n-1) + binomial(n, 2)*(2^(n-2)-2) - 2*n, 0); \\ Michel Marcus, Feb 13 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Feb 12 2023
STATUS
approved
