A045931 Number of partitions of n with equal number of even and odd parts.
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
Keywords
Examples
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)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..3500 (first 1001 terms from David W. Wilson)
Crossrefs
Programs
-
Maple
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
-
Mathematica
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 *)
Formula
G.f.: Sum_{k>=0} x^(3*k)/Product_{i=1..k} (1-x^(2*i))^2. - Vladeta Jovovic, Aug 18 2007
a(n) = A000041(n)-A171967(n) = A130780(n)-A108950(n) = A171966(n)-A108949(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = A000041(n) - A108950(n) - A108949(n) = A130780(n) + A171966(n) - A000041(n). - Gus Wiseman, Jan 23 2022
a(n) ~ Pi * exp(Pi*sqrt(2*n/3)) / (48*n^(3/2)). - Vaclav Kotesovec, Jun 15 2025
Comments