A240021
Number T(n,k) of partitions of n into distinct parts, where k is the difference between the number of odd parts and the number of even parts; triangle T(n,k), n>=0, read by rows.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 0, 0, 1, 2, 1, 1, 1, 0, 1, 1, 1, 3, 1, 1, 1, 0, 2, 2, 2, 4, 1, 0, 1, 2, 1, 1, 4, 2, 4, 5, 1, 1, 1, 1, 2, 1, 2, 6, 3, 1, 6, 6, 1, 2, 2, 1, 3, 1, 5, 9, 3, 2, 9, 7, 2, 4, 3, 2, 3, 2, 8, 12, 4, 0, 1, 4, 12, 8, 3, 7, 4, 3, 4, 3, 14, 16, 4, 1, 1, 7, 16, 9, 6, 11, 5, 1, 4, 4, 6, 20, 20, 5, 2, 2
Offset: 0
T(12,-3) = 1: [6,4,2].
T(12,-2) = 2: [10,2], [8,4].
T(12,-1) = 1: [12].
T(12,0) = 2: [6,3,2,1], [5,4,2,1].
T(12,1) = 6: [9,2,1], [8,3,1], [7,4,1], [7,3,2], [6,5,1], [5,4,3].
T(12,2) = 3: [11,1], [9,3], [7,5].
T(13,-1) = 6: [10,2,1], [8,4,1], [8,3,2], [7,4,2], [6,5,2], [6,4,3].
T(14,-2) = 3: [12,2], [10,4], [8,6].
Triangle T(n,k) begins:
: n\k : -3 -2 -1 0 1 2 3 ...
+-----+--------------------------
: 0 : 1
: 1 : 1
: 2 : 1
: 3 : 1, 1
: 4 : 1, 0, 0, 1
: 5 : 2, 1
: 6 : 1, 1, 0, 1, 1
: 7 : 1, 3, 1
: 8 : 1, 1, 0, 2, 2
: 9 : 2, 4, 1, 0, 1
: 10 : 2, 1, 1, 4, 2
: 11 : 4, 5, 1, 1, 1
: 12 : 1, 2, 1, 2, 6, 3
: 13 : 1, 6, 6, 1, 2, 2
: 14 : 1, 3, 1, 5, 9, 3
Columns k=0-10 give:
A239241,
A239871(n+1),
A240138,
A240139,
A240140,
A240141,
A240142,
A240143,
A240144,
A240145,
A240146.
-
b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,
expand(b(n, i-1)+`if`(i>n, 0, b(n-i, i-1)*x^(2*irem(i, 2)-1)))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(b(n$2)):
seq(T(n), n=0..20);
-
b[n_, i_] := b[n, i] = If[n>i*(i+1)/2, 0, If[n == 0, 1, Expand[b[n, i-1] + If[i>n, 0, b[n-i, i-1]*x^(2*Mod[i, 2]-1)]]]]; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, Exponent[p, x, Min], Exponent[p, x]}]][b[n, n]]; Table[ T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Alois P. Heinz *)
-
N=20; q='q+O('q^N);
e(n) = if(n%2!=0, u, 1/u);
gf = prod(n=1,N, 1 + e(n)*q^n );
V = Vec( gf );
{ for (j=1, #V, \\ print triangle, including leading zeros
for (i=0, N-j, print1(" ")); \\ padding
for (i=-j+1, j-1, print1(polcoeff(V[j], i, u),", "));
print();
); }
/* Joerg Arndt, Apr 01 2014 */
A239880
Number of strict partitions of n having an ordering in which no parts of equal parity are juxtaposed and the first and last terms have the same parity.
Original entry on oeis.org
0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 7, 10, 11, 14, 15, 19, 22, 26, 30, 35, 42, 47, 56, 62, 76, 83, 100, 108, 132, 142, 171, 184, 222, 239, 284, 306, 363, 394, 460, 500, 581, 636, 730, 802, 914, 1010, 1139, 1262, 1415, 1577, 1753, 1956, 2163, 2423, 2663
Offset: 0
a(12) counts these 7 partitions: [12], [9,2,1], [3,8,1], [7,4,1], [7,2,3], [5,6,1], [5,4,3].
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2 or
abs(t)-n>1, 0, `if`(n=0, abs(t), b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i-1, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..80); # Alois P. Heinz, Apr 02 2014
-
d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &];
p[n_] := p[n] = Select[d[n], Abs[Count[#, ?OddQ] - Count[#, ?EvenQ]] == 1 &]; t = Table[p[n], {n, 0, 12}]
TableForm[t] (* shows the partitions *)
u = Table[Length[p[n]], {n, 0, 60}] (* A239880 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n > i*(i+1)/2 || Abs[t]-n>1, 0, If[n==0, Abs[t], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t + (2*Mod[i, 2]-1)]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
A239882
Number of strict partitions of 2n having an ordering of the parts in which no two neighboring parts have the same parity.
Original entry on oeis.org
1, 1, 1, 2, 3, 6, 9, 15, 22, 33, 46, 65, 87, 117, 153, 199, 254, 324, 408, 512, 639, 795, 986, 1221, 1509, 1862, 2298, 2830, 3485, 4285, 5267, 6460, 7920, 9687, 11836, 14426, 17557, 21310, 25823, 31204, 37632, 45262, 54326, 65029, 77678, 92549, 110035, 130509
Offset: 0
a(6) counts these 9 partitions of 12: [12], [9,2,1], [3,8,1], [7,4,1], [7,2,3], [5,6,1], [6,3,2,1], [5,4,3], [5,4,1,2]
-
d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &]; p[n_] := p[n] = Select[d[n], Abs[Count[#, ?OddQ] - Count[#, ?EvenQ]] <= 1 &]; t = Table[p[n], {n, 0, 12}]
TableForm[t] (* shows the partitions *)
u = Table[Length[p[2 n]], {n, 0, 40}] (* A239882 *)
(* Peter J. C. Moses, Mar 10 2014 *)
A239883
Number of strict partitions of 2n + 1 having an ordering of the parts in which no two neighboring parts have the same parity.
Original entry on oeis.org
1, 2, 3, 5, 7, 10, 13, 18, 23, 31, 41, 55, 73, 99, 132, 177, 236, 313, 412, 540, 701, 904, 1159, 1473, 1861, 2336, 2915, 3615, 4463, 5478, 6698, 8152, 9887, 11944, 14391, 17280, 20703, 24739, 29506, 35115, 41730, 49501, 58650, 69389, 82009, 96807, 114175
Offset: 0
a(5) counts these 10 partitions of 11: [11], [10,1], [9,2], [8,3], [8,1,2], [7,4], [6,5], [6,1,4], [6,3,2], [4,5,2].
-
d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &]; p[n_] := p[n] = Select[d[n], Abs[Count[#, ?OddQ] - Count[#, ?EvenQ]] <= 1 &]; t = Table[p[n], {n, 0, 12}]
TableForm[t] (* shows the partitions *)
u = Table[Length[p[2 n + 1]], {n, 0, 20}] (* A239883 *)
(* Peter J. C. Moses, Mar 10 2014 *)
Showing 1-4 of 4 results.
Comments