cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Views

Author

Keywords

Comments

The trivariate g.f. with x marking weight (i.e., sum of the parts), t marking number of odd parts and s marking number of even parts, is 1/product((1-tx^(2j-1))(1-sx^(2j)), j=1..infinity). - Emeric Deutsch, Mar 30 2006

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)
		

Crossrefs

The version for subsets of {1..n} is A001405.
Dominated by A027187 (partitions of even length).
More odd/even parts: A108950/A108949.
More or same number of odd/even parts: A130780/A171966.
The strict case is A239241.
This is column k = 0 of the triangle A240009.
Counting only distinct parts gives A241638, ranked by A325700.
A half-conjugate version is A277579.
These partitions are ranked by A325698.
A000041 counts integer partitions, strict A000009.
A047993 counts balanced partitions, ranked by A106529.
A257991/A257992 count odd/even parts by Heinz number.

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