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.
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
Examples
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;
Links
- Alois P. Heinz, Rows n = 0..120, flattened
Crossrefs
Columns k=(-1)-10 give: A239832, A045931, A240010, A240011, A240012, A240013, A240014, A240015, A240016, A240017, A240018, A240019.
Row sums give A000041.
T(2n,n) gives A002865.
T(4n,2n) gives A182746.
T(4n+2,2n+1) gives A182747.
Row lengths give A016777(floor(n/2)).
Programs
-
Maple
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);
-
Mathematica
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 *)
-
PARI
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 */
Formula
G.f.: 1 / prod(n>=1, 1 - e(n)*q^n ) = 1 + sum(n>=1, e(n)*q^n / prod(k=1..n, 1-e(k)*q^k) ) where e(n) = u if n odd, otherwise 1/u; see Pari program. [Joerg Arndt, Mar 31 2014]
Comments