A239241
Number of partitions of n into distinct parts for which (number of odd parts) = (number of even parts).
Original entry on oeis.org
1, 0, 0, 1, 0, 2, 0, 3, 0, 4, 1, 5, 2, 6, 5, 7, 8, 8, 14, 9, 20, 11, 30, 13, 40, 17, 55, 23, 70, 32, 91, 45, 112, 65, 140, 91, 169, 128, 206, 177, 245, 241, 295, 323, 350, 429, 419, 559, 499, 722, 600, 921, 721, 1162, 874, 1452, 1062, 1800, 1299, 2210
Offset: 0
a(9) = 4 counts these partitions: 81, 72, 63, 54.
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, `if`(t=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 15 2014
-
z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n > i*(i+1)/2, 0, If[n==0, If[t==0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t + If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Dec 27 2015, after Alois P. Heinz *)
A242618
Number T(n,k) of partitions of n, where k is the difference between the number of odd parts and the number of even parts, both counted without multiplicity; triangle T(n,k), n>=0, read by rows.
Original entry on oeis.org
1, 1, 1, 0, 1, 1, 2, 2, 1, 1, 1, 4, 2, 1, 1, 2, 3, 3, 2, 1, 8, 3, 3, 2, 4, 6, 5, 5, 4, 13, 8, 4, 1, 5, 5, 11, 13, 7, 1, 11, 20, 14, 9, 2, 1, 6, 13, 17, 26, 11, 3, 1, 22, 31, 27, 15, 5, 2, 12, 18, 34, 44, 18, 7, 4, 40, 47, 51, 23, 11, 5, 16, 36, 56, 72, 34, 11, 1
Offset: 0
Triangle T(n,k) begins:
: n\k : -3 -2 -1 0 1 2 3 ...
+-----+---------------------------
: 0 : 1;
: 1 : 1;
: 2 : 1, 0, 1;
: 3 : 1, 2;
: 4 : 2, 1, 1, 1;
: 5 : 4, 2, 1;
: 6 : 1, 2, 3, 3, 2;
: 7 : 1, 8, 3, 3;
: 8 : 2, 4, 6, 5, 5;
: 9 : 4, 13, 8, 4, 1;
: 10 : 5, 5, 11, 13, 7, 1;
: 11 : 11, 20, 14, 9, 2;
: 12 : 1, 6, 13, 17, 26, 11, 3;
: 13 : 1, 22, 31, 27, 15, 5;
: 14 : 2, 12, 18, 34, 44, 18, 7;
Columns k=(-10)-10 give:
A242682,
A242683,
A242684,
A242685,
A242686,
A242687,
A242688,
A242689,
A242690,
A242691,
A241638,
A242692,
A242693,
A242694,
A242695,
A242696,
A242697,
A242698,
A242699,
A242700,
A242701.
Cf.
A240009 (parts counted with multiplicity),
A240021 (distinct parts),
A242626 (compositions counted without multiplicity).
-
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
expand(b(n, i-1)+add(b(n-i*j, i-1)*x^(2*irem(i, 2)-1), j=1..n/i))))
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 == 0, 1, If[i < 1, 0, Expand[b[n, i - 1] + Sum[b[n - i*j, i - 1]*x^(2*Mod[i, 2] - 1), {j, 1, n/i}]]]]; 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, Dec 12 2016 after Alois P. Heinz *)
A240009
Number T(n,k) of partitions of n, where k is the difference between the number of odd parts and the number of even parts; triangle T(n,k), n>=0, -floor(n/2)+(n mod 2)<=k<=n, read by rows.
Original entry on oeis.org
1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 0, 1, 1, 2, 3, 2, 2, 2, 1, 1, 0, 1, 1, 1, 2, 2, 2, 4, 3, 2, 2, 1, 1, 0, 1, 1, 2, 4, 5, 3, 4, 4, 2, 2, 1, 1, 0, 1, 1, 1, 2, 3, 3, 5, 7, 5, 4, 4, 2, 2, 1, 1, 0, 1, 1, 2, 4, 7, 7, 6, 8, 6, 4, 4, 2, 2, 1, 1, 0, 1
Offset: 0
T(5,-1) = 1: [2,2,1].
T(5,0) = 2: [4,1], [3,2].
T(5,1) = 1: [5].
T(5,2) = 1: [2,1,1,1].
T(5,3) = 1: [3,1,1].
T(5,5) = 1: [1,1,1,1,1].
Triangle T(n,k) begins:
: n\k : -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 ...
+-----+----------------------------------------------------
: 0 : 1;
: 1 : 1;
: 2 : 1, 0, 0, 1;
: 3 : 1, 1, 0, 1;
: 4 : 1, 1, 0, 1, 1, 0, 1;
: 5 : 1, 2, 1, 1, 1, 0, 1;
: 6 : 1, 1, 1, 1, 2, 2, 1, 1, 0, 1;
: 7 : 1, 2, 3, 2, 2, 2, 1, 1, 0, 1;
: 8 : 1, 1, 2, 2, 2, 4, 3, 2, 2, 1, 1, 0, 1;
: 9 : 1, 2, 4, 5, 3, 4, 4, 2, 2, 1, 1, 0, 1;
: 10 : 1, 1, 2, 3, 3, 5, 7, 5, 4, 4, 2, 2, 1, 1, 0, 1;
Columns k=(-1)-10 give:
A239832,
A045931,
A240010,
A240011,
A240012,
A240013,
A240014,
A240015,
A240016,
A240017,
A240018,
A240019.
Row lengths give
A016777(floor(n/2)).
Cf.
A240021 (the same for partitions into distinct parts),
A242618 (the same for parts counted without multiplicity).
-
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
expand(b(n, i-1)+`if`(i>n, 0, b(n-i, i)*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..14);
-
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<1, 0, b[n, i-1] + If[i>n, 0, b[n-i, i]*x^(2*Mod[i, 2]-1)]]]; T[n_] := (degree = Exponent[b[n, n], x]; ldegree = -Exponent[b[n, n] /. x -> 1/x, x]; Table[Coefficient[b[n, n], x, i], {i, ldegree, degree}]); Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 06 2015, translated from Maple *)
-
N=20; q='q+O('q^N);
e(n) = if(n%2!=0, u, 1/u);
gf = 1 / 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, Mar 31 2014 */
A242498
Number T(n,k) of compositions of n, where k is the difference between the number of odd parts and the number of even parts; triangle T(n,k), n>=0, -floor(n/2)+(n mod 2)<=k<=n, read by rows.
Original entry on oeis.org
1, 1, 1, 0, 0, 1, 2, 1, 0, 1, 1, 1, 0, 3, 2, 0, 1, 3, 4, 1, 4, 3, 0, 1, 1, 2, 1, 6, 9, 3, 5, 4, 0, 1, 4, 9, 6, 11, 16, 6, 6, 5, 0, 1, 1, 3, 3, 11, 24, 18, 19, 25, 10, 7, 6, 0, 1, 5, 16, 18, 28, 51, 40, 31, 36, 15, 8, 7, 0, 1, 1, 4, 6, 19, 51, 60, 65, 95, 75, 48, 49, 21, 9, 8, 0, 1
Offset: 0
Triangle T(n,k) begins:
: n\k : -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 ...
+-----+---------------------------------------------------------
: 0 : 1;
: 1 : 1;
: 2 : 1, 0, 0, 1;
: 3 : 2, 1, 0, 1;
: 4 : 1, 1, 0, 3, 2, 0, 1;
: 5 : 3, 4, 1, 4, 3, 0, 1;
: 6 : 1, 2, 1, 6, 9, 3, 5, 4, 0, 1;
: 7 : 4, 9, 6, 11, 16, 6, 6, 5, 0, 1;
: 8 : 1, 3, 3, 11, 24, 18, 19, 25, 10, 7, 6, 0, 1;
: 9 : 5, 16, 18, 28, 51, 40, 31, 36, 15, 8, 7, 0, 1;
: 10 : 1, 4, 6, 19, 51, 60, 65, 95, 75, 48, 49, 21, 9, 8, 0, 1;
Columns k=0-10 gives:
A098123,
A242499,
A242500,
A242501,
A242502,
A242503,
A242504,
A242505,
A242506,
A242507,
A242508.
Row lengths give
A016777(floor(n/2)).
-
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0, expand(
add(x^(j*(2*irem(i, 2)-1))*b(n-i*j, i-1, p+j)/j!, j=0..n/i))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(b(n$2, 0)):
seq(T(n), n=0..20);
-
b[n_, i_, p_] := b[n, i, p] = If[n == 0, p!, If[i<1, 0, Expand[Sum[x^(j*(2*Mod[i, 2]-1))*b[n-i*j, i-1, p+j]/j!, {j, 0, n/i}]]]] ; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, Exponent[p, x, Min], Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Alois P. Heinz *)
A239240
Number of partitions of n into distinct parts for which (number of odd parts) <= (number of even parts).
Original entry on oeis.org
1, 0, 1, 1, 1, 2, 2, 4, 2, 6, 4, 9, 6, 13, 10, 18, 15, 24, 24, 32, 35, 43, 51, 56, 72, 74, 100, 97, 136, 128, 183, 168, 241, 222, 315, 290, 408, 381, 522, 497, 664, 647, 839, 837, 1054, 1081, 1317, 1384, 1641, 1767, 2035, 2242, 2519, 2831, 3108, 3555, 3828
Offset: 0
a(7) = 4 counts these partitions: 61, 52, 43, 421.
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, `if`(t<=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 15 2014
-
z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n==0, If[t <= 0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
A239243
Number of partitions of n into distinct parts for which (number of odd parts) >= (number of even parts).
Original entry on oeis.org
1, 1, 0, 2, 1, 3, 2, 4, 4, 6, 7, 8, 11, 11, 17, 16, 25, 22, 36, 31, 49, 44, 68, 61, 90, 85, 120, 118, 156, 160, 204, 217, 261, 291, 337, 386, 429, 507, 548, 662, 694, 854, 882, 1096, 1112, 1396, 1406, 1765, 1768, 2219, 2223, 2776, 2784, 3451, 3484, 4275
Offset: 0
a(8) = 4 counts these partitions: 71, 53, 521, 431.
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, `if`(t>=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 15 2014
-
z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n==0, If[t>=0, 1, 0], b[n, i-1, t]+If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
A239242
Number of partitions of n into distinct parts for which (number of odd parts) > (number of even parts).
Original entry on oeis.org
0, 1, 0, 1, 1, 1, 2, 1, 4, 2, 6, 3, 9, 5, 12, 9, 17, 14, 22, 22, 29, 33, 38, 48, 50, 68, 65, 95, 86, 128, 113, 172, 149, 226, 197, 295, 260, 379, 342, 485, 449, 613, 587, 773, 762, 967, 987, 1206, 1269, 1497, 1623, 1855, 2063, 2289, 2610, 2823, 3280, 3471
Offset: 0
a(8) = 4 counts these partitions: 71, 53, 521, 431.
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, `if`(t>0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 15 2014
-
z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n==0, If[t>0, 1, 0], b[n, i-1, t]+If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
A239871
Number of strict partitions of n having 1 more even part than odd, so that there is at least one ordering of the parts in which the even and odd parts alternate, and the first and last terms are even.
Original entry on oeis.org
0, 0, 1, 0, 1, 0, 1, 1, 1, 2, 1, 4, 1, 6, 1, 9, 2, 12, 3, 16, 6, 20, 10, 25, 17, 30, 26, 36, 40, 43, 57, 51, 81, 61, 110, 74, 148, 91, 193, 113, 250, 144, 316, 184, 397, 239, 491, 311, 603, 407, 732, 530, 885, 692, 1061, 895, 1268, 1155, 1508, 1478, 1790
Offset: 0
a(11) counts these 4 partitions: 812, 614, 632, 452.
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2 or
abs(t)>n, 0, `if`(n=0, 1, 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, 1):
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], Count[#, ?OddQ] == -1 + Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 20}]
TableForm[t] (* shows the partitions *)
u = Table[Length[p[n]], {n, 0, 70}] (* A239871 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n > i*(i + 1)/2 || Abs[t] > n, 0, If[n == 0, 1, 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, 1]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Nov 16 2015, after Alois P. Heinz *)
A239239
Number of strict partitions of n having fewer odd parts than even.
Original entry on oeis.org
0, 0, 1, 0, 1, 0, 2, 1, 2, 2, 3, 4, 4, 7, 5, 11, 7, 16, 10, 23, 15, 32, 21, 43, 32, 57, 45, 74, 66, 96, 92, 123, 129, 157, 175, 199, 239, 253, 316, 320, 419, 406, 544, 514, 704, 652, 898, 825, 1142, 1045, 1435, 1321, 1798, 1669, 2234, 2103, 2766, 2646, 3404
Offset: 0
a(6) counts these partitions: 6, 42.
-
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, `if`(t<0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..60); # Alois P. Heinz, Mar 15 2014
-
z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n == 0, If[t<0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2] == 1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
A239881
Number of strict partitions of n having an ordering in which no parts of equal parity are juxtaposed.
Original entry on oeis.org
1, 1, 1, 2, 1, 3, 2, 5, 3, 7, 6, 10, 9, 13, 15, 18, 22, 23, 33, 31, 46, 41, 65, 55, 87, 73, 117, 99, 153, 132, 199, 177, 254, 236, 324, 313, 408, 412, 512, 540, 639, 701, 795, 904, 986, 1159, 1221, 1473, 1509, 1861, 1862, 2336, 2298, 2915, 2830, 3615, 3485
Offset: 0
a(12) counts these 9 partitions: [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[n]], {n, 0, 60}] (* A239880 *)
(* Peter J. C. Moses, Mar 10 2014 *)
Showing 1-10 of 20 results.
Comments