A032020
Number of compositions (ordered partitions) of n into distinct parts.
Original entry on oeis.org
1, 1, 1, 3, 3, 5, 11, 13, 19, 27, 57, 65, 101, 133, 193, 351, 435, 617, 851, 1177, 1555, 2751, 3297, 4757, 6293, 8761, 11305, 15603, 24315, 30461, 41867, 55741, 74875, 98043, 130809, 168425, 257405, 315973, 431065, 558327, 751491, 958265, 1277867, 1621273
Offset: 0
a(6) = 11 because 6 = 5+1 = 4+2 = 3+2+1 = 3+1+2 = 2+4 = 2+3+1 = 2+1+3 = 1+5 = 1+3+2 = 1+2+3.
From _Gus Wiseman_, Jun 25 2020: (Start)
The a(0) = 1 through a(7) = 13 strict compositions:
() (1) (2) (3) (4) (5) (6) (7)
(1,2) (1,3) (1,4) (1,5) (1,6)
(2,1) (3,1) (2,3) (2,4) (2,5)
(3,2) (4,2) (3,4)
(4,1) (5,1) (4,3)
(1,2,3) (5,2)
(1,3,2) (6,1)
(2,1,3) (1,2,4)
(2,3,1) (1,4,2)
(3,1,2) (2,1,4)
(3,2,1) (2,4,1)
(4,1,2)
(4,2,1)
(End)
- Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17.
- Alois P. Heinz, Table of n, a(n) for n = 0..10000 (first 1001 terms from T. D. Noe)
- C. G. Bower, Transforms (2)
- Martin Klazar, What is an answer? — remarks, results and problems on PIO formulas in combinatorial enumeration, part I, arXiv:1808.08449 [math.CO], 2018.
- B. Richmond and A. Knopfmacher, Compositions with distinct parts, Aequationes Mathematicae 49 (1995), pp. 86-97.
- B. Richmond and A. Knopfmacher, Compositions with distinct parts, Aequationes Mathematicae 49 (1995), pp. 86-97. (free access)
- Gus Wiseman, Sequences counting and ranking compositions by the patterns they match or avoid.
Dominated by
A003242 (anti-run compositions).
These compositions are ranked by
A233564.
(1,1)-avoiding patterns are counted by
A000142.
Numbers with strict prime signature are
A130091.
(1,1,1)-avoiding compositions are counted by
A232432.
(1,1)-matching compositions are counted by
A261982.
Inseparable partitions are counted by
A325535.
Patterns matched by compositions are counted by
A335456.
Strict permutations of prime indices are counted by
A335489.
-
b:= proc(n, i) b(n, i):= `if`(n=0, [1], `if`(i<1, [], zip((x, y)
-> x+y, b(n, i-1), `if`(i>n, [], [0, b(n-i, i-1)[]]), 0))) end:
a:= proc(n) local l; l:=b(n, n): add((i-1)! *l[i], i=1..nops(l)) end:
seq(a(n), n=0..50); # Alois P. Heinz, Dec 12 2012
# second Maple program:
T:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
`if`(k=0, `if`(n=0, 1, 0), T(n-k, k) +k*T(n-k, k-1)))
end:
a:= n-> add(T(n, k), k=0..floor((sqrt(8*n+1)-1)/2)):
seq(a(n), n=0..60); # Alois P. Heinz, Sep 04 2015
-
f[list_]:=Length[list]!; Table[Total[Map[f, Select[IntegerPartitions[n], Sort[#] == Union[#] &]]], {n, 0,30}]
T[n_, k_] := T[n, k] = If[k<0 || n<0, 0, If[k==0, If[n==0, 1, 0], T[n-k, k] + k*T[n-k, k-1]]]; a[n_] := Sum[T[n, k], {k, 0, Floor[(Sqrt[8*n + 1] - 1) / 2]}]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Sep 22 2015, after Alois P. Heinz *)
-
N=66; q='q+O('q^N);
gf=sum(n=0,N, n!*q^(n*(n+1)/2) / prod(k=1,n, 1-q^k ) );
Vec(gf)
/* Joerg Arndt, Oct 20 2012 */
-
Q(N) = { \\ A008289
my(q = vector(N)); q[1] = [1, 0, 0, 0];
for (n = 2, N,
my(m = (sqrtint(8*n+1) - 1)\2);
q[n] = vector((1 + (m>>2)) << 2); q[n][1] = 1;
for (k = 2, m, q[n][k] = q[n-k][k] + q[n-k][k-1]));
return(q);
};
seq(N) = concat(1, apply(q -> sum(k = 1, #q, q[k] * k!), Q(N)));
seq(43) \\ Gheorghe Coserea, Sep 09 2018
A327245
Number T(n,k) of colored compositions of n using all colors of a k-set such that all parts have different color patterns and the patterns for parts i have i colors in (weakly) increasing order; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
Original entry on oeis.org
1, 0, 1, 0, 1, 3, 0, 3, 10, 13, 0, 3, 39, 87, 75, 0, 5, 100, 510, 836, 541, 0, 11, 303, 2272, 7042, 9025, 4683, 0, 13, 782, 9999, 46628, 104255, 109110, 47293, 0, 19, 2009, 39369, 284319, 948725, 1662273, 1466003, 545835, 0, 27, 5388, 154038, 1577256, 7676830, 19798096, 28538496, 21713032, 7087261
Offset: 0
T(3,1) = 3: 3aaa, 2aa1a, 1a2aa.
T(3,2) = 10: 3aab, 3abb, 2aa1b, 2ab1a, 2ab1b, 2bb1a, 1a2ab, 1a2bb, 1b2aa, 1b2ab.
T(3,3) = 13: 3abc, 2ab1c, 2ac1b, 2bc1a, 1a2bc, 1b2ac, 1c2ab, 1a1b1c, 1a1c1b, 1b1a1c, 1b1c1a, 1c1a1b, 1c1b1a.
Triangle T(n,k) begins:
1;
0, 1;
0, 1, 3;
0, 3, 10, 13;
0, 3, 39, 87, 75;
0, 5, 100, 510, 836, 541;
0, 11, 303, 2272, 7042, 9025, 4683;
0, 13, 782, 9999, 46628, 104255, 109110, 47293;
0, 19, 2009, 39369, 284319, 948725, 1662273, 1466003, 545835;
...
-
C:= binomial:
b:= proc(n, i, k, p) option remember; `if`(n=0, p!, `if`(i<1, 0, add(
b(n-i*j, min(n-i*j, i-1), k, p+j)*C(C(k+i-1, i), j), j=0..n/i)))
end:
T:= (n, k)-> add(b(n$2, i, 0)*(-1)^(k-i)*C(k, i), i=0..k):
seq(seq(T(n, k), k=0..n), n=0..10);
-
c = Binomial;
b[n_, i_, k_, p_] := b[n, i, k, p] = If[n == 0, p!, If[i < 1, 0, Sum[b[n - i*j, Min[n - i*j, i-1], k, p + j] c[c[k + i - 1, i], j], {j, 0, n/i}]]];
T[n_, k_] := Sum[b[n, n, i, 0] (-1)^(k - i) c[k, i], {i, 0, k}];
Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 29 2020, after Alois P. Heinz *)
A120774
Number of ordered set partitions of [n] where equal-sized blocks are ordered with increasing least elements.
Original entry on oeis.org
1, 1, 2, 8, 31, 147, 899, 5777, 41024, 322488, 2749325, 25118777, 245389896, 2554780438, 28009868787, 323746545433, 3933023224691, 49924332801387, 661988844566017, 9138403573970063, 131043199040556235, 1949750421507432009, 30031656711776544610
Offset: 0
A179233 begins 1; 1; 1 1; 6 1 1; 8 3 18 1 1 ... with row sums 1, 1 2 8 31 147 ...
a(3) = 8: 123, 1|23, 23|1, 2|13, 13|2, 3|12, 12|3, 1|2|3. - _Alois P. Heinz_, Apr 27 2017
-
b:= proc(n, i, p) option remember; `if`(n=0 or i=1,
(p+n)!/n!, add(b(n-i*j, i-1, p+j)*combinat
[multinomial](n, n-i*j, i$j)/j!^2, j=0..n/i))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..25); # Alois P. Heinz, Apr 27 2017
-
f[{x_,y_}]:= x!^y y!; Table[Total[Table[n!,{PartitionsP[n]}]/Apply[Times,Map[f,Map[Tally,Partitions[n]],{2}],2] * Apply[Multinomial,Map[Last,Map[Tally,Partitions[n]],{2}],2]],{n,0,20}] (* Geoffrey Critzer, Sep 29 2011 *)
Leading 1 inserted, definition simplified by
R. J. Mathar, Sep 28 2011
A327673
Number T(n,k) of colored compositions of n using all colors of a k-set such that all parts have different color patterns and the patterns for parts i are sorted and have i colors (in arbitrary order); triangle T(n,k), n>=0, 0<=k<=n, read by rows.
Original entry on oeis.org
1, 0, 1, 0, 1, 3, 0, 3, 18, 19, 0, 3, 60, 171, 121, 0, 5, 210, 1173, 1996, 1041, 0, 11, 798, 7512, 22784, 27225, 11191, 0, 13, 2462, 39708, 196904, 411115, 382086, 130663, 0, 19, 7891, 204987, 1546042, 4991815, 7843848, 5932843, 1731969
Offset: 0
T(3,1) = 3: 3aaa, 2aa1a, 1a2aa.
T(3,2) = 18: 3aab, 3aba, 3baa, 3abb, 3bab, 3bba, 2aa1b, 2ab1a, 2ba1a, 2ab1b, 2ba1b, 2bb1a, 1a2ab, 1a2ba, 1a2bb, 1b2aa, 1b2ab, 1b2ba.
T(3,3) = 19: 3abc, 3acb, 3bac, 3bca, 3cab, 3cba, 2ab1c, 2ac1b, 2ba1c, 2bc1a, 2ca1b, 2cb1a, 1a2bc, 1a2cb, 1b2ac, 1b2ca, 1c2ab, 1c2ba, 1a1b1c.
Triangle T(n,k) begins:
1;
0, 1;
0, 1, 3;
0, 3, 18, 19;
0, 3, 60, 171, 121;
0, 5, 210, 1173, 1996, 1041;
0, 11, 798, 7512, 22784, 27225, 11191;
0, 13, 2462, 39708, 196904, 411115, 382086, 130663;
...
-
b:= proc(n, i, k, p) option remember;
`if`(n=0, p!, `if`(i<1, 0, add(binomial(k^i, j)*
b(n-i*j, min(n-i*j, i-1), k, p+j)/j!, j=0..n/i)))
end:
T:= (n, k)-> add(b(n$2, i, 0)*(-1)^(k-i)*binomial(k, i), i=0..k):
seq(seq(T(n, k), k=0..n), n=0..10);
-
b[n_, i_, k_, p_] := b[n, i, k, p] = If[n==0, p!, If[i<1, 0, Sum[Binomial[ k^i, j] b[n - i j, Min[n - i j, i - 1], k, p + j]/j!, {j, 0, n/i}]]];
T[n_, k_] := Sum[b[n, n, i, 0] (-1)^(k - i) Binomial[k, i], {i, 0, k}];
Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 30 2020, after Maple *)
A309670
Number of colored compositions of n using all colors of an initial interval of the color palette such that all parts have different color patterns and the patterns for parts i are sorted and have i colors in (weakly) increasing order.
Original entry on oeis.org
1, 1, 3, 21, 115, 813, 7627, 71173, 740023, 8544169, 107195083, 1434581205, 20499413667, 312262663989, 4992164670007, 84221279919193, 1492818584618099, 27607818180267269, 533522844488072987, 10724970103003953053, 223859943086157531063, 4847766598150865273721
Offset: 0
-
C:= binomial:
b:= proc(n, i, k, p) option remember; `if`(n=0, p!, `if`(i<1, 0, add(
b(n-i*j, min(n-i*j, i-1), k, p+j)/j!*C(C(k+i-1, i), j), j=0..n/i)))
end:
a:= n-> add(add(b(n$2, i, 0)*(-1)^(k-i)*C(k, i), i=0..k), k=0..n):
seq(a(n), n=0..23);
-
c = Binomial;
b[n_, i_, k_, p_] := b[n, i, k, p] = If[n == 0, p!, If[i<1, 0, Sum[b[n - i*j, Min[n - i*j, i-1], k, p+j]/j!*c[c[k+i-1, i], j], {j, 0, n/i}]]];
a[n_] := Sum[Sum[b[n, n, i, 0]*(-1)^(k-i)*c[k, i], {i, 0, k}], {k, 0, n}];
Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Mar 05 2022, after Alois P. Heinz *)
A327595
Total number of colors in all colored compositions of n using all colors of an initial interval of the color palette such that all parts have different color patterns and the patterns for parts i are sorted and have i colors in (weakly) increasing order.
Original entry on oeis.org
0, 1, 5, 47, 343, 2989, 33185, 360963, 4279363, 55461897, 771543693, 11345355815, 176710558327, 2913914537349, 50149603855065, 906096874764227, 17125269159665511, 336432862441344121, 6882511824853124773, 146018382159954093023, 3207861915702573763355
Offset: 0
-
C:= binomial:
b:= proc(n, i, k, p) option remember; `if`(n=0, p!, `if`(i<1, 0, add(
b(n-i*j, min(n-i*j, i-1), k, p+j)/j!*C(C(k+i-1, i), j), j=0..n/i)))
end:
a:= n-> add(add(k*b(n$2, i, 0)*(-1)^(k-i)*C(k, i), i=0..k), k=0..n):
seq(a(n), n=0..21);
-
c = Binomial;
b[n_, i_, k_, p_] := b[n, i, k, p] = If[n == 0, p!, If[i < 1, 0, Sum[
b[n-i*j, Min[n-i*j, i-1], k, p+j]/j!*c[c[k+i-1, i], j], {j, 0, n/i}]]];
a[n_] := Sum[Sum[k*b[n, n, i, 0]*(-1)^(k-i)*c[k, i], {i, 0, k}], {k, 0, n}];
Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Apr 11 2022, after Alois P. Heinz *)
A327596
Number of colored compositions of 2n using all colors of an n-set such that all parts have different color patterns and the patterns for parts i are sorted and have i colors in (weakly) increasing order.
Original entry on oeis.org
1, 1, 27, 1222, 78819, 7990555, 1075539168, 185948116920, 39826324710186, 10231314625984628, 3097070454570888110, 1088018981038197792790, 436918864329884469153204, 198400793333371519398942287, 100941775818744369615731919906, 57064609834208008799145534143376
Offset: 0
-
C:= binomial:
b:= proc(n, i, k, p) option remember; `if`(n=0, p!, `if`(i<1, 0, add(
b(n-i*j, min(n-i*j, i-1), k, p+j)/j!*C(C(k+i-1, i), j), j=0..n/i)))
end:
a:= n-> add(b(2*n$2, i, 0)*(-1)^(n-i)*C(n, i), i=0..n):
seq(a(n), n=0..17);
-
c = Binomial;
b[n_, i_, k_, p_] := b[n, i, k, p] = If[n == 0, p!, If[i < 1, 0, Sum[
b[n-i*j, Min[n-i*j, i-1], k, p+j]/j!*c[c[k+i-1, i], j], {j, 0, n/i}]]];
a[n_] := Sum[b[2n, 2n, i, 0]*(-1)^(n-i)*c[n, i], {i, 0, n}];
Table[a[n], {n, 0, 17}] (* Jean-François Alcover, Apr 11 2022, after Alois P. Heinz *)
A327841
Number of colored compositions of n using all colors of a 2-set such that all parts have different color patterns and the patterns for parts i are sorted and have i colors in (weakly) increasing order.
Original entry on oeis.org
0, 0, 2, 10, 27, 70, 223, 508, 1193, 2822, 7048, 15690, 35072, 79018, 167667, 382976, 823599, 1742082, 3765187, 7785290, 16299074, 34337380, 70503188, 143916326, 296390373, 597048414, 1202172962, 2416614660, 4813022691, 9551780272, 18833189269, 37248671816
Offset: 0
-
b:= proc(n, i, k, p) option remember; `if`(n=0, p!,
`if`(i<1, 0, add(b(n-i*j, min(n-i*j, i-1), k, p+j)/
j!*binomial(binomial(k+i-1, i), j), j=0..n/i)))
end:
a:= n-> (k-> add(b(n$2, i, 0)*(-1)^(k-i)*
binomial(k, i), i=0..k))(2):
seq(a(n), n=0..35);
Showing 1-8 of 8 results.
Comments