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.

Showing 1-10 of 26 results. Next

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

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

Views

Author

Reinhard Zumkeller, Jan 21 2010

Keywords

Comments

a(n) = A108949(n) + A045931(n) = A000041(n) - A108950(n).
a(n) = Sum_{k=-floor(n/2)+(n mod 2)..0} A240009(n,k). - Alois P. Heinz, Mar 30 2014

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    $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

Views

Author

Vladeta Jovovic, Aug 19 2007

Keywords

Comments

a(n) = A108950(n) + A045931(n) = A000041(n) - A108949(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = Sum_{k=0..n} A240009(n,k). - Alois P. Heinz, Mar 30 2014

Examples

			a(5)=6 because we have 5,41,32,311,211 and 11111 (221 does not qualify).
		

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    $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 *)

Formula

G.f.: Sum_{k>=0} x^k/Product_{i=1..k} (1-x^(2*i))^2.

Extensions

More terms from Emeric Deutsch, Aug 24 2007

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

Views

Author

Alois P. Heinz, May 19 2014

Keywords

Comments

T(n,0) = A241638(n).
Sum_{k<0} T(n,k) = A241640(n).
Sum_{k<=0} T(n,k) = A241639(n).
Sum_{k>=0} T(n,k) = A241637(n).
Sum_{k>0} T(n,k) = A241636(n).
T(n^2,n) = T(n^2+n,-n) = 1.
T(n^2+n,n) = Sum_{k} T(n,k) = A000041(n).
T(n^2+3*n,-n) = A000712(n).

Examples

			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;
		

Crossrefs

Row sums give A000041.
Cf. A240009 (parts counted with multiplicity), A240021 (distinct parts), A242626 (compositions counted without multiplicity).

Programs

  • Maple
    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);
  • Mathematica
    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

Views

Author

Gus Wiseman, Jan 21 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), so these are numbers with the same number of even prime indices as odd conjugate prime indices.
These are also partitions for which the number of even parts is equal to the positive alternating sum of the parts.

Examples

			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)
		

Crossrefs

A subset of A028260 (even bigomega), counted by A027187.
These partitions are counted by A277579.
This is the half-conjugate version of A325698, counted by A045931.
A000041 counts partitions, strict A000009.
A047993 counts balanced partitions, ranked by A106529.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A100824 counts partitions with at most one odd part, ranked by A349150.
A108950/A108949 count partitions with more odd/even parts.
A122111 represents conjugation using Heinz numbers.
A130780/A171966 count partitions with more or equal odd/even parts.
A257991/A257992 count odd/even prime indices.
A316524 gives the alternating sum of prime indices (reverse: A344616).

Programs

  • Mathematica
    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]&]

Formula

A257992(a(n)) = A257991(A122111(a(n))).

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

Views

Author

Alois P. Heinz, Mar 31 2014

Keywords

Comments

T(n,k) is defined for all n >= 0, k in A001057. Row n contains all terms from the leftmost to the rightmost nonzero term. All other terms (not in the triangle) are equal to 0. First nonzero term of column k>=0 is at n = k^2, first nonzero term of column k<=0 is at n = k*(k+1).
T(n,k) = T(n+k,-k).
T(2n*(2n+1),2n) = A000041(n).
T(4n^2+14n+11,2n+2) = A000070(n).
T(n^2,n) = 1.
T(n^2,n-1) = 0.
T(n^2,n-2) = A209815(n+1).
T(n^2+1,n-1) = A000065(n).
T(n,0) = A239241(n).
Sum_{k<=-1} T(n,k) = A239239(n).
Sum_{k<=0} T(n,k) = A239240(n).
Sum_{k>=1} T(n,k) = A239242(n).
Sum_{k>=0} T(n,k) = A239243(n).
Sum_{k=-1..1} T(n,k) = A239881(n).
T(n,-1) + T(n,1) = A239880(n).
Sum_{k=-n..n} T(n,k) = A000009 (row sums).

Examples

			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
		

Crossrefs

Programs

  • Maple
    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);
  • Mathematica
    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 *)
  • PARI
    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 */

Formula

G.f.: prod(n>=1, 1 + e(n)*q^n ) = 1 + sum(n>=1, e(n)*q^n * prod(k=1..n-1, 1+e(k)*q^k) ) where e(n) = u if n odd, otherwise 1/u; see Pari program. [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

Views

Author

Vladeta Jovovic, Sep 24 2004

Keywords

Examples

			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)
		

Crossrefs

For partitions: A045931, ranked by A325698, strict A239241 (conj A352129).
Column k=0 of A242498.
Without multiplicity: A242821, for partitions A241638 (ranked by A325700).
These compositions are ranked by A355321.
A047993 counts balanced partitions, ranked by A106529.
A108950/A108949 count partitions with more odd/even parts.
A130780/A171966 count partitions with more or as many odd/even parts.
Cf. A025178.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Count[#,?EvenQ]==Count[#,?OddQ]&]],{n,0,15}] (* Gus Wiseman, Jun 26 2022 *)

Formula

a(n) = Sum_{k=floor(n/3)..floor(n/2)} C(2*n-4*k,n-2*k)*C(n-1-k,2*n-4*k-1).
Recurrence: n*(2*n-7)*a(n) = 2*(n-2)*(2*n-5)*a(n-2) + 2*(2*n-7)*(2*n-3)*a(n-3) - (n-4)*(2*n-3)*a(n-4). - Vaclav Kotesovec, May 01 2014
a(n) ~ sqrt(c) * d^n / sqrt(Pi*n), where d = 1.94696532812840456026081823863... is the root of the equation 1-4*d-2*d^2+d^4 = 0, c = 0.225563290820392765554898545739... is the root of the equation 43*c^4-18*c^2+8*c-1=0. - Vaclav Kotesovec, May 01 2014
G.f.: 1/sqrt(1 - 4*x^3/(1-x^2)^2). - Seiichi Manyama, May 01 2025

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

Views

Author

Alois P. Heinz, May 16 2014

Keywords

Comments

T(n,k) = T(n+k,-k).

Examples

			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;
		

Crossrefs

Row sums give A011782.
Diagonals include: A000012, A000004, A001477, A000217, A000290, A180415.
Row lengths give A016777(floor(n/2)).

Programs

  • Maple
    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);
  • Mathematica
    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

Views

Author

Len Smiley, Jul 21 2005

Keywords

Examples

			a(6) = 3: {[6], [4,2], [2,2,2]}; a(7) = 3: {[4,2,1], [3,2,2], [2,2,2,1]}.
		

Crossrefs

Cf. A045931 for #even parts = #odd parts, A108950 for #even parts < #odd parts.
Cf. A171966, A130780. - Reinhard Zumkeller, Jan 21 2010

Programs

  • Maple
    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
  • 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 *)
    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 *)
  • PARI
    a(n) = {nb = 0; forpart(p=n, nb += (2*#(select(x->x%2, Vec(p))) < #p);); nb;} \\ Michel Marcus, Nov 02 2015

Formula

a(n) = A171966(n) - A045931(n) = A171967(n) - A108950(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = Sum_{k=-floor(n/2)+(n mod 2)..-1} A240009(n,k). - Alois P. Heinz, Mar 30 2014
G.f.: (Product_{k>=1} 1/(1-x^(2*k-1)))*Sum_{n>=1} q^(2*n^2)*(1-q^(n))/Product_{k=1..n} (1-q^(2*k))^2. - Jeremy Lovejoy, Jan 12 2021

Extensions

More terms from Joerg Arndt, Oct 04 2012

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

Views

Author

Len Smiley, Jul 21 2005

Keywords

Examples

			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]}.
		

Crossrefs

Cf. A045931 for #even parts = #odd parts, A108949 for #even parts > #odd parts.
Cf. A171966, A171967. - Reinhard Zumkeller, Jan 21 2010

Programs

  • Maple
    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
  • Mathematica
    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 *)

Formula

G.f.: Sum_{k>=0} x^k*(1-x^(2*k))/Product_{i=1..k} (1-x^(2*i))^2. - Vladeta Jovovic, Aug 19 2007
a(n) = A130780(n) - A045931(n) = A171967(n) - A108949(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = Sum_{k=1..n} A240009(n,k). - Alois P. Heinz, Mar 30 2014
G.f.: (Product_{k>=1} 1/(1-x^(2*k-1)))*Sum_{n>=1} q^(2*n^2-n)*(1-q^(2*n))/Product_{k=1..n} (1-q^(2*k))^2. - Jeremy Lovejoy, Jan 12 2021

Extensions

More terms from Joerg Arndt, Oct 04 2012
Showing 1-10 of 26 results. Next