A235998
Triangle read by rows: T(n,k) is the number of compositions of n having k distinct parts (n>=1, 1<=k<=floor((sqrt(1+8*n)-1)/2)).
Original entry on oeis.org
1, 2, 2, 2, 3, 5, 2, 14, 4, 22, 6, 2, 44, 18, 4, 68, 56, 3, 107, 146, 4, 172, 312, 24, 2, 261, 677, 84, 6, 396, 1358, 288, 2, 606, 2666, 822, 4, 950, 5012, 2226, 4, 1414, 9542, 5304, 120, 5, 2238, 17531, 12514, 480, 2, 3418, 32412, 27904, 1800, 6, 5411, 58995, 61080, 5580
Offset: 1
Triangle begins:
1;
2;
2, 2;
3, 5;
2, 14;
4, 22, 6;
2, 44, 18;
4, 68, 56;
3, 107, 146;
4, 172, 312, 24;
2, 261, 677, 84;
6, 396, 1358, 288;
2, 606, 2666, 822;
4, 950, 5012, 2226;
4, 1414, 9542, 5304, 120;
5, 2238, 17531, 12514, 480;
2, 3418, 32412, 27904, 1800;
6, 5411, 58995, 61080, 5580;
...
-
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
expand(add(b(n-i*j, i-1, p+j)/j!*`if`(j=0, 1, x), j=0..n/i))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n$2, 0)):
seq(T(n), n=1..25); # Alois P. Heinz, Jan 20 2014, revised May 25 2014
-
b[n_, i_, p_] := b[n, i, p] = If[n==0, p!, If[i<1, 0, Sum[b[n-i*j, i-1, p+ j]/j!*If[j==0, 1, x], {j, 0, n/i}]]]; T[n_] := Function[p, Table[ Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 1, 25}] // Flatten (* Jean-François Alcover, Dec 10 2015, after Alois P. Heinz *)
A242900
Number of compositions of n into exactly two different parts with distinct multiplicities.
Original entry on oeis.org
3, 10, 12, 38, 56, 79, 152, 251, 284, 594, 920, 1108, 2136, 3402, 4407, 8350, 12863, 17328, 33218, 52527, 70074, 133247, 214551, 294299, 547360, 883572, 1234509, 2284840, 3667144, 5219161, 9551081, 15386201, 22079741, 40061664, 64666975, 93985744, 168363731
Offset: 4
a(4) = 3: [2,1,1], [1,2,1], [1,1,2].
a(5) = 10: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [2,2,1], [2,1,2], [1,2,2], [3,1,1], [1,3,1], [1,1,3].
Cf.
A182473 (the same for partitions),
A131661 (multiplicities may be equal).
-
with(numtheory):
a:= n-> add(add(add(`if`(dm, binomial((n-p*m)
/d+m, m), 0), d=divisors(n-p*m)), m=1..n/p), p=2..n-1):
seq(a(n), n=4..60);
-
div[0] = {}; div[n_] := Divisors[n]; a[n_] := Sum[Sum[Sum[If[dJean-François Alcover, Feb 11 2015, after Alois P. Heinz *)
A242911
Half the number of compositions of n into exactly two different parts with equal multiplicities.
Original entry on oeis.org
1, 1, 2, 5, 3, 6, 14, 10, 5, 56, 6, 15, 153, 51, 8, 502, 9, 217, 1756, 25, 11, 7023, 264, 30, 24363, 1852, 14, 93629, 15, 6576, 352782, 40, 3827, 1377543, 18, 45, 5200379, 105812, 20, 20063228, 21, 352942, 77607976, 55, 23, 301906830, 5172, 185320, 1166803215
Offset: 3
a(6) = 5 because there are 10 compositions of 6 into exactly two different parts with equal multiplicities: [1,5], [5,1], [2,4], [4,2], [1,1,2,2], [1,2,1,2], [1,2,2,1], [2,1,1,2], [2,1,2,1], [2,2,1,1].
-
a:= n-> add(iquo(d-1, 2)*binomial(2*n/d, n/d),
d=numtheory[divisors](n))/2:
seq(a(n), n=3..60);
-
a[n_] := DivisorSum[n, Quotient[#-1, 2]*Binomial[2n/#, n/#]&]/2; Table[ a[n], {n, 3, 60}] (* Jean-François Alcover, Feb 28 2017, translated from Maple *)
Showing 1-3 of 3 results.
Comments