|
|
A189886
|
|
a(n) is the number of compositions of the set {1, 2, ..., n} into blocks, each of size 1, 2 or 3 (n >= 0).
|
|
12
|
|
|
1, 1, 3, 13, 74, 530, 4550, 45570, 521640, 6717480, 96117000, 1512819000, 25975395600, 483169486800, 9678799930800, 207733600074000, 4755768505488000, 115681418156304000, 2979408725813520000, 80998627977002736000, 2317937034142810080000, 69649003197501567840000, 2192459412316607834400000, 72152830779716793506400000, 2477756318984329979756160000
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Sequences of sets, each set having no more than 3 elements.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = sum(m=0..n, sum(j=0..3*m-n, n!/(2^(n+j-2*m) * 3^(m-j)) * C(m,j) * C(j,n+2*j-3*m))) where C(n,k) is the binomial coefficient.
a(n) = n * a(n-1) + n*(n-1)/2 * a(n-2) + n*(n-1)*(n-2)/6 * a(n-3). - Istvan Mezo, Jun 06 2013
|
|
EXAMPLE
|
a(3) = 13 because all compositions of set {a,b,c} into blocks of size 1, 2, or 3 are:
1: ({a,b,c}),
2: ({a},{b,c}),
3: ({b,c},{a}),
4: ({b},{a,c}),
5: ({a,c},{b}),
6: ({c},{a,b}),
7: ({a,b},{c}),
8: ({a},{b},{c}),
9: ({a},{c},{b}),
10: ({b},{a},{c}),
11: ({b},{c},{a}),
12: ({c},{a},{b}),
13: ({c},{b},{a}).
|
|
MAPLE
|
A189886 := proc(n) local m, j; add(add(2^(2*m-n-j)*3^(j-m)*n!
*binomial(m, j)*binomial(j, 2*j-(3*m-n)), j=0..3*m-n), m=0..n) end:
# second Maple program:
a:= proc(n) option remember; `if`(n=0, 1, add(
a(n-i)*binomial(n, i), i=1..min(n, 3)))
end:
# third Maple program:
a:= n-> n! * (<<0|1|0>, <0|0|1>, <1/6|1/2|1>>^n)[3, 3]:
|
|
MATHEMATICA
|
Table[Sum[n!/(2^(n+j-2m)3^(m-j))*Binomial[m, j]*Binomial[j, n+2j-3m], {m, 0, n}, {j, 0, 3m-n}], {n, 0, 15}]
|
|
PROG
|
(PARI) a(n)=sum(m=0, n, sum(j=0, 3*m-n, n!/(2^(n+j-2*m) *3^(m-j)) *binomial(m, j) *binomial(j, n+2*j-3*m))); /* Joerg Arndt, May 03 2011 */
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|