A045931
Number of partitions of n with equal number of even and odd parts.
Original entry on oeis.org
1, 0, 0, 1, 0, 2, 1, 3, 2, 5, 5, 7, 9, 11, 16, 18, 25, 28, 41, 44, 62, 70, 94, 107, 140, 163, 207, 245, 302, 361, 440, 527, 632, 763, 904, 1090, 1285, 1544, 1812, 2173, 2539, 3031, 3538, 4202, 4896, 5793, 6736, 7934, 9221, 10811, 12549, 14661, 16994, 19780
Offset: 0
a(9) = 5 because we have [8,1], [7,2], [6,3], [5,4] and [2,2,2,1,1,1].
From _Gus Wiseman_, Jan 23 2022: (Start)
The a(0) = 1 through a(12) = 9 partitions (A = 10, empty columns indicated by dots):
() . . 21 . 32 2211 43 3221 54 3322 65 4332
41 52 4211 63 4321 74 4431
61 72 4411 83 5322
81 5221 92 5421
222111 6211 A1 6321
322211 6411
422111 7221
8211
22221111
(End)
The version for subsets of {1..n} is
A001405.
Dominated by
A027187 (partitions of even length).
This is column k = 0 of the triangle
A240009.
A half-conjugate version is
A277579.
These partitions are ranked by
A325698.
-
g:=1/product((1-t*x^(2*j-1))*(1-s*x^(2*j)),j=1..30): gser:=simplify(series(g,x=0,56)): P[0]:=1: for n from 1 to 53 do P[n]:=subs(s=1/t,coeff(gser,x^n)) od: seq(coeff(t*P[n],t),n=0..53); # Emeric Deutsch, Mar 30 2006
-
p[n_] := p[n] = Select[IntegerPartitions[n], Count[#, ?OddQ] == Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 10}] (* partitions of n with # odd parts = # even parts *)
TableForm[t] (* partitions, vertical format *)
Table[Length[p[n]], {n, 0, 30}] (* A045931 *)
(* Peter J. C. Moses, Mar 10 2014 *)
nmax = 100; CoefficientList[Series[Sum[x^(3*k) / Product[(1 - x^(2*j))^2, {j, 1, k}], {k, 0, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jun 15 2025 *)
A171966
Number of partitions of n having no more odd than even parts.
Original entry on oeis.org
1, 0, 1, 1, 2, 3, 4, 6, 8, 12, 15, 21, 28, 37, 49, 63, 83, 105, 138, 171, 223, 275, 353, 433, 551, 673, 846, 1031, 1282, 1558, 1922, 2327, 2848, 3440, 4179, 5032, 6078, 7293, 8763, 10482, 12534, 14943, 17797, 21146, 25090, 29719, 35138, 41493, 48908, 57578
Offset: 0
-
b:= proc(n, i, t) option remember; `if`(n=0,
`if`(t<=0, 1, 0), `if`(i<1, 0, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..80); # Alois P. Heinz, Mar 30 2014
-
$RecursionLimit = 1000; b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t <= 0, 1, 0], If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t+(2*Mod[i, 2]-1)]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Jun 30 2015, after Alois P. Heinz *)
A130780
Number of partitions of n such that number of odd parts is greater than or equal to number of even parts.
Original entry on oeis.org
1, 1, 1, 3, 3, 6, 8, 12, 16, 23, 32, 42, 58, 75, 102, 131, 173, 220, 288, 363, 466, 587, 743, 929, 1164, 1448, 1797, 2224, 2738, 3368, 4122, 5042, 6133, 7466, 9035, 10941, 13184, 15888, 19064, 22876, 27343
Offset: 0
a(5)=6 because we have 5,41,32,311,211 and 11111 (221 does not qualify).
-
g:=sum(x^k/(product((1-x^(2*i))^2,i=1..k)),k=0..50): gser:=series(g,x=0,50): seq(coeff(gser,x,n),n=1..40); # Emeric Deutsch, Aug 24 2007
# second Maple program:
b:= proc(n, i, t) option remember; `if`(n=0,
`if`(t>=0, 1, 0), `if`(i<1, 0, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..80); # Alois P. Heinz, Mar 30 2014
-
$RecursionLimit = 1000; b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t >= 0, 1, 0], If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t + (2*Mod[i, 2]-1)]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 12 2015, after Alois P. Heinz *)
opgQ[n_]:=Module[{len=Length[n],op},op=Length[Select[n,OddQ]];op>= len-op]; Table[Count[IntegerPartitions[n],?(opgQ)],{n,0,50}] (* _Harvey P. Dale, Dec 12 2021 *)
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 *)
A349157
Heinz numbers of integer partitions where the number of even parts is equal to the number of odd conjugate parts.
Original entry on oeis.org
1, 4, 6, 15, 16, 21, 24, 25, 35, 60, 64, 77, 84, 90, 91, 96, 100, 121, 126, 140, 143, 150, 210, 221, 240, 247, 256, 289, 297, 308, 323, 336, 351, 360, 364, 375, 384, 400, 437, 462, 484, 490, 495, 504, 525, 529, 546, 551, 560, 572, 585, 600, 625, 667, 686, 726
Offset: 1
The terms and their prime indices begin:
1: ()
4: (1,1)
6: (2,1)
15: (3,2)
16: (1,1,1,1)
21: (4,2)
24: (2,1,1,1)
25: (3,3)
35: (4,3)
60: (3,2,1,1)
64: (1,1,1,1,1,1)
77: (5,4)
84: (4,2,1,1)
90: (3,2,2,1)
91: (6,4)
96: (2,1,1,1,1,1)
These partitions are counted by
A277579.
A100824 counts partitions with at most one odd part, ranked by
A349150.
A122111 represents conjugation using Heinz numbers.
A316524 gives the alternating sum of prime indices (reverse:
A344616).
Cf.
A000700,
A000712,
A035363,
A066207,
A066208,
A097613,
A215366,
A239241,
A240009,
A241638,
A316523,
A325700,
A340604.
-
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
conj[y_]:=If[Length[y]==0,y,Table[Length[Select[y,#>=k&]],{k,1,Max[y]}]];
Select[Range[100],Count[primeMS[#],?EvenQ]==Count[conj[primeMS[#]],?OddQ]&]
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 */
A098123
Number of compositions of n with equal number of even and odd parts.
Original entry on oeis.org
1, 0, 0, 2, 0, 4, 6, 6, 24, 28, 60, 130, 190, 432, 770, 1386, 2856, 5056, 9828, 18918, 34908, 68132, 128502, 244090, 470646, 890628, 1709136, 3271866, 6238986, 11986288, 22925630, 43932906, 84349336, 161625288, 310404768, 596009494
Offset: 0
From _Gus Wiseman_, Jun 26 2022: (Start)
The a(0) = 1 through a(7) = 6 compositions (empty columns indicated by dots):
() . . (12) . (14) (1122) (16)
(21) (23) (1212) (25)
(32) (1221) (34)
(41) (2112) (43)
(2121) (52)
(2211) (61)
(End)
These compositions are ranked by
A355321.
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 *)
A108949
Number of partitions of n with more even parts than odd parts.
Original entry on oeis.org
0, 0, 1, 0, 2, 1, 3, 3, 6, 7, 10, 14, 19, 26, 33, 45, 58, 77, 97, 127, 161, 205, 259, 326, 411, 510, 639, 786, 980, 1197, 1482, 1800, 2216, 2677, 3275, 3942, 4793, 5749, 6951, 8309, 9995, 11912, 14259, 16944, 20194, 23926, 28402, 33559, 39687, 46767, 55120, 64780, 76110, 89222
Offset: 0
a(6) = 3: {[6], [4,2], [2,2,2]}; a(7) = 3: {[4,2,1], [3,2,2], [2,2,2,1]}.
Cf.
A045931 for #even parts = #odd parts,
A108950 for #even parts < #odd parts.
-
with(combinat,partition):
evnbigrodd:=proc(n::nonnegint)
local evencount,oddcount,bigcount,parts,i,j;
bigcount:=0;
partitions:=partition(n);
for i from 1 to nops(partitions) do
evencount:=0;
oddcount:=0;
for j from 1 to nops(partitions[i]) do
if (op(j,partitions[i]) mod 2 <>0) then
oddcount:=oddcount+1
fi;
if (op(j,partitions[i]) mod 2 =0) then
evencount:=evencount+1
fi
od;
if (evencount>oddcount) then
bigcount:=bigcount+1
fi
od;
return(bigcount)
end proc;
seq(evnbigrodd(i),i=1..42);
# second Maple program:
b:= proc(n, i, t) option remember; `if`(n=0,
`if`(t<0, 1, 0), `if`(i<1, 0, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..80); # Alois P. Heinz, Mar 30 2014
-
p[n_] := p[n] = Select[IntegerPartitions[n], Count[#, ?OddQ] == Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 10}] (* partitions of n with # odd parts = # even parts *)
TableForm[t] (* partitions, vertical format *)
Table[Length[p[n]], {n, 0, 30}] (* A045931 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n==0, If[t<0, 1, 0], If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t+(2*Mod[i, 2]-1)]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Nov 02 2015, after Alois P. Heinz *)
-
a(n) = {nb = 0; forpart(p=n, nb += (2*#(select(x->x%2, Vec(p))) < #p);); nb;} \\ Michel Marcus, Nov 02 2015
A108950
Number of partitions of n with more odd parts than even parts.
Original entry on oeis.org
1, 1, 2, 3, 4, 7, 9, 14, 18, 27, 35, 49, 64, 86, 113, 148, 192, 247, 319, 404, 517, 649, 822, 1024, 1285, 1590, 1979, 2436, 3007, 3682, 4515, 5501, 6703, 8131, 9851, 11899, 14344, 17252, 20703, 24804, 29640, 35377, 42115, 50085, 59415, 70420, 83261, 98365, 115947, 136557
Offset: 1
a(4) = 3: {[3,1], [2,1,1], [1,1,1,1]}; a(5) = 4: {[5], [3,1,1], [2,1,1,1], [1,1,1,1,1]}.
Cf.
A045931 for #even parts = #odd parts,
A108949 for #even parts > #odd parts.
-
with(combinat,partition):oddbigrevn:=proc(n::nonnegint) local evencount,oddcount,bigcount,parts,i,j; printlevel:=-1;bigcount:=0; partitions:=partition(n);for i from 1 to nops(partitions) do evencount:=0; oddcount:=0;for j from 1 to nops(partitions[i]) do if (op(j,partitions[i]) mod 2 <>0) then oddcount:=oddcount+1 fi; if (op(j,partitions[i]) mod 2 =0) then evencount:=evencount+1 fi od; if (evencount0, 1, 0), `if`(i<1, 0, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=1..80); # Alois P. Heinz, Mar 30 2014
-
p[n_] := p[n] = Select[IntegerPartitions[n], Count[#, ?OddQ] > Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 15}] (* partitions of n with # odd parts > # even parts *)
TableForm[t] (* partitions, vertical format *)
Table[Length[p[n]], {n, 1, 30}] (* A108950 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n==0, If[t>0, 1, 0], If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t + (2*Mod[i, 2]-1)]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Nov 16 2015, after Alois P. Heinz *)
Showing 1-10 of 26 results.
Comments