A097805 Number of compositions of n with k parts, T(n, k) = binomial(n-1, k-1) for n, k >= 1 and T(n, 0) = 0^n, triangle read by rows for n >= 0 and 0 <= k <= n.
1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 0, 1, 4, 6, 4, 1, 0, 1, 5, 10, 10, 5, 1, 0, 1, 6, 15, 20, 15, 6, 1, 0, 1, 7, 21, 35, 35, 21, 7, 1, 0, 1, 8, 28, 56, 70, 56, 28, 8, 1, 0, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 0, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 0, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1
Offset: 0
A103919 Triangle of numbers of partitions of n with total number of odd parts equal to k from {0,...,n}.
1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 2, 0, 2, 0, 1, 0, 4, 0, 2, 0, 1, 3, 0, 5, 0, 2, 0, 1, 0, 7, 0, 5, 0, 2, 0, 1, 5, 0, 9, 0, 5, 0, 2, 0, 1, 0, 12, 0, 10, 0, 5, 0, 2, 0, 1, 7, 0, 17, 0, 10, 0, 5, 0, 2, 0, 1, 0, 19, 0, 19, 0, 10, 0, 5, 0, 2, 0, 1, 11, 0, 28, 0, 20, 0, 10, 0, 5, 0, 2, 0, 1, 0, 30, 0, 33, 0, 20, 0, 10, 0, 5, 0, 2, 0, 1
Offset: 0
Comments
The partition (0) of n=0 is included. For n>0 no part 0 appears.
The first (k=0) column gives the number of partitions without odd parts, i.e., those with even parts only. See A035363.
Without the alternating zeros this becomes a triangle with columns given by the rows of the S_n(m) table shown in the Riordan reference.
From Gregory L. Simay, Oct 31 2015: (Start)
T(2n+k,k) = the number of partitions of n with parts 1..k of two kinds. If n<=k, then T(2n+k) = A000712(n), the number of partitions of n with parts of two kinds.
T(2n+k) = the convolution of A000041(n) and the number of partitions of n+k having exactly k parts.
T(2n+k) = d(n,k) where d(n,0) = p(n) and d(n,k) = d(n,k-1) + d(n-k,k-1) + d(n-2k,k-1) + ... (End)
From Emeric Deutsch, Oct 04 2016: (Start)
T(n,k) = number of partitions (p1 >= p2 >= p3 >= ...) of n having alternating sum p1 - p2 + p3 - ... = k. Example: T(5,3) = 2 because there are two partitions (3,1,1) and (4,1) of 5 with alternating sum 3.
The equidistribution of the partition statistics "alternating sum" and "total number of odd parts" follows by conjugation. (End)
Examples
The triangle a(n,k) begins: n\k 0 1 2 3 4 5 6 7 8 9 10 0: 1 1: 0 1 2: 1 0 1 3: 0 2 0 1 4: 2 0 2 0 1 5: 0 4 0 2 0 1 6: 3 0 5 0 2 0 1 7: 0 7 0 5 0 2 0 1 8: 5 0 9 0 5 0 2 0 1 9: 0 12 0 10 0 5 0 2 0 1 10: 7 0 17 0 10 0 5 0 2 0 1 ... Reformatted - _Wolfdieter Lang_, Apr 28 2013 a(0,0) = 1 because n=0 has no odd part, only one even part, 0, by definition. a(5,3) = 2 because there are two partitions (1,1,3) and (1,1,1,2) of 5 with exactly 3 odd parts. From _Gregory L. Simay_, Oct 31 2015: (Start) T(10,4) = T(2*3+4,4) = d(3,4) = A000712(3) = 10. T(10,2) = T(2*4+2,2) = d(4,2) = d(4,1)+d(2,1)+d(0,1) = d(4,0)+d(3,0)+d(2,0)+d(1,0)+d(0,0) + d(2,0)+d(1,0)+d(0,0) + d(0,0) = convolution sum p(4)+p(3)+2*p(2)+2*p(1)+3*p(0) = 5+3+2*2+2*1+3*1 = 17. T(9,1) = T(8,0) + T(7,1) = 5 + 7 = 12. (End)
References
- J. Riordan, Combinatorial Identities, Wiley, 1968, p. 199.
Links
- Alois P. Heinz, Rows n = 0..140, flattened
- D. Kim, A. J. Yee, A note on partitions into distinct parts and odd parts, Ramanujan J. 3 (1999), 227-231. [_R. J. Mathar_, Nov 11 2008]
- Wolfdieter Lang, First 11 rows.
Crossrefs
Row sums gives A000041 (partition numbers). Columns: k=0: A035363 (with zero entries) A000041 (without zero entries), k=1: A000070, k=2: A000097, k=3: A000098, k=4: A000710, 3k>=n: A000712.
Cf. A066897.
The reverse version (without zeros) is the right half of A344612.
Removing all zeros gives A344651.
The strict reverse version (without zeros) is the right half of A344739.
Programs
-
Maple
g:=1/product((1-t*x^(2*j-1))*(1-x^(2*j)),j=1..20): gser:=simplify(series(g,x=0,22)): P[0]:=1: for n from 1 to 18 do P[n]:=coeff(gser,x^n) od: for n from 0 to 18 do seq(coeff(P[n],t,j),j=0..n) od; # yields sequence in triangular form # Emeric Deutsch, Feb 17 2006
-
Mathematica
T[n_, k_] := T[n, k] = Which[n
Jean-François Alcover, Mar 05 2014, after Paul D. Hanna *) Table[Length[Select[IntegerPartitions[n],Count[#,?OddQ]==k&]],{n,0,15},{k,0,n}] (* _Gus Wiseman, Jun 20 2021 *) -
PARI
{T(n, k)=if(n>=k, if(n==k, 1, if((n-k+1)%2==0, 0, if(k==0, sum(m=0, n, T(n\2, m)), T(n-1, k-1)+T(n-2*k, k)))))} for(n=0, 20, for(k=0, n, print1(T(n, k), ", ")); print("")) \\ Paul D. Hanna, Apr 27 2013
Formula
a(n, k) = number of partitions of n>=0, which have exactly k odd parts (and possibly even parts) for k from {0, ..., n}.
Sum_{k=0..n} k*T(n,k) = A066897(n). - Emeric Deutsch, Feb 17 2006
G.f.: G(t,x) = 1/Product_{j>=1} (1-t*x^(2*j-1))*(1-x^(2*j)). - Emeric Deutsch, Feb 17 2006
G.f. T(2n+k,k) = g.f. d(n,k) = (1/Product_{j=1..k} (1-x^j)) * g.f. p(n). - Gregory L. Simay, Oct 31 2015
T(n,k) = T(n-1,k-1) + T(n-2k,k). - Gregory L. Simay, Nov 01 2015
A344612 Triangle read by rows where T(n,k) is the number of integer partitions of n with reverse-alternating sum k ranging from -n to n in steps of 2.
1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 2, 1, 1, 0, 1, 2, 3, 3, 1, 1, 0, 1, 2, 4, 3, 3, 1, 1, 0, 1, 2, 4, 5, 5, 3, 1, 1, 0, 1, 2, 4, 7, 5, 6, 3, 1, 1, 0, 1, 2, 4, 8, 7, 9, 6, 3, 1, 1, 0, 1, 2, 4, 8, 12, 7, 11, 6, 3, 1, 1, 0, 1, 2, 4, 8, 14, 11, 14, 12, 6, 3, 1, 1
Offset: 0
Comments
The reverse-alternating sum of a partition (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i. This is also (-1)^(k-1) times the sum of the even-indexed parts minus the sum of the odd-indexed parts.
Also the number of reversed integer partitions of n with alternating sum k ranging from -n to n in steps of 2.
Also the number of integer partitions of n with (-1)^(m-1) * b = k where m is the greatest part and b is the number of odd parts, with k ranging from -n to n in steps of 2.
Examples
Triangle begins: 1 0 1 0 1 1 0 1 1 1 0 1 2 1 1 0 1 2 2 1 1 0 1 2 3 3 1 1 0 1 2 4 3 3 1 1 0 1 2 4 5 5 3 1 1 0 1 2 4 7 5 6 3 1 1 0 1 2 4 8 7 9 6 3 1 1 0 1 2 4 8 12 7 11 6 3 1 1 0 1 2 4 8 14 11 14 12 6 3 1 1 0 1 2 4 8 15 19 11 18 12 6 3 1 1 0 1 2 4 8 15 24 15 23 20 12 6 3 1 1 0 1 2 4 8 15 26 30 15 31 21 12 6 3 1 1 For example, row n = 7 counts the following partitions: (61) (52) (43) (331) (322) (511) (7) (4111) (2221) (22111) (421) (3211) (1111111) (31111) (211111) Row n = 9 counts the following partitions: 81 72 63 54 441 333 522 711 9 6111 4221 3222 22221 432 621 5211 3321 33111 531 51111 411111 4311 2211111 32211 222111 111111111 42111 321111 3111111 21111111
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..1325 (rows 0..50)
Crossrefs
Programs
-
Mathematica
sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}]; Table[Length[Select[IntegerPartitions[n],sats[#]==k&]],{n,0,15},{k,-n,n,2}]
-
PARI
row(n)={my(v=vector(n+1)); forpart(p=n, my(s=-sum(i=1, #p, p[i]*(-1)^i)); v[(s+n)/2+1]++); v} \\ Andrew Howroyd, Jan 06 2024
A000097 Number of partitions of n if there are two kinds of 1's and two kinds of 2's.
1, 2, 5, 9, 17, 28, 47, 73, 114, 170, 253, 365, 525, 738, 1033, 1422, 1948, 2634, 3545, 4721, 6259, 8227, 10767, 13990, 18105, 23286, 29837, 38028, 48297, 61053, 76926, 96524, 120746, 150487, 187019, 231643, 286152, 352413, 432937, 530383, 648245
Offset: 0
Comments
Also number of partitions of 2*n with exactly 2 odd parts (offset 1). - Vladeta Jovovic, Jan 12 2005
Also number of transitions from one partition of n+2 to another, where a transition consists of replacing any two parts with their sum. Remove all 1' and 2' from the partition, replacing them with ((number of 2') + 1) and ((number of 1') + (number of 2') + 1); these are the two parts being summed. Number of partitions of n into parts of 2 kinds with at most 2 parts of the second kind, or of n+2 into parts of 2 kinds with exactly 2 parts of the second kind. - Franklin T. Adams-Watters, Mar 20 2006
From Christian Gutschwager (gutschwager(AT)math.uni-hannover.de), Feb 10 2010: (Start)
a(n) is also the number of pairs of partitions of n+2 which differ by only one box (for bijection see the first Gutschwager link).
a(n) is also the number of partitions of n with two parts marked.
a(n) is also the number of partitions of n+1 with two different parts marked. (End)
a(n) = P(/2,n), a particular case of P(/k,n) defined as follows: P(/0,n) = A000041(n) and P(/k,n) = P(/k-1, n) + P(/k-1,n-k) + P(/k-1, n-2k) + ... Also, P(/k,n) = the convolution of A000041 and the partitions of n with exactly k parts, and g.f. P(/k,n) = (g.f. for P(n)) * 1/(1-x)...(1-x^k). - Gregory L. Simay, Mar 22 2018
a(n) is also the sum of binomial(D(p),2) in partitions p of (n+3), where D(p)= number of different sizes of parts in p. - Emily Anible, Apr 03 2018
Also partitions of 2*(n+1) with alternating sum 2. Also partitions of 2*(n+1) with reverse-alternating sum -2 or 2. - Gus Wiseman, Jun 21 2021
Define the distance graph of the partitions of n using the distance function in A366156 as follows: two vertices (partitions) share an edge if and only if the distance between the vertices is 2. Then a(n) is the number of edges in the distance graph of the partitions of n. - Clark Kimberling, Oct 12 2023
Examples
a(3) = 9 because we have 3, 2+1, 2+1', 2'+1, 2'+1', 1+1+1, 1+1+1', 1+1'+1' and 1'+1'+1'. From _Gus Wiseman_, Jun 22 2021: (Start) The a(0) = 1 through a(4) = 9 partitions of 2*(n+1) with exactly 2 odd parts: (1,1) (3,1) (3,3) (5,3) (2,1,1) (5,1) (7,1) (3,2,1) (3,3,2) (4,1,1) (4,3,1) (2,2,1,1) (5,2,1) (6,1,1) (3,2,2,1) (4,2,1,1) (2,2,2,1,1) The a(0) = 1 through a(4) = 9 partitions of 2*(n+1) with alternating sum 2: (2) (3,1) (4,2) (5,3) (2,1,1) (2,2,2) (3,3,2) (3,2,1) (4,3,1) (3,1,1,1) (3,2,2,1) (2,1,1,1,1) (4,2,1,1) (2,2,2,1,1) (3,2,1,1,1) (3,1,1,1,1,1) (2,1,1,1,1,1,1) (End)
References
- H. Gupta et al., Tables of Partitions. Royal Society Mathematical Tables, Vol. 4, Cambridge Univ. Press, 1958, p. 90.
- J. Riordan, Combinatorial Identities, Wiley, 1968, p. 199.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- T. D. Noe and Vaclav Kotesovec, Table of n, a(n) for n = 0..10000 (terms 0..1000 from T. D. Noe)
- P. J. Cameron, Sequences realized by oligomorphic permutation groups, J. Integ. Seqs. Vol. 3 (2000), #00.1.5.
- Christian Gutschwager, The skew diagram poset and components of skew characters, arXiv:1104.0008 [math.CO], 2011.
- Christian Gutschwager, Reduced Kronecker products which are multiplicity free or contain only a few components, Eur. J. Combinat. 31 (2010) 1996-2005. doi:10.1016/j.ejc.2010.05.008.
- J. P. Robinson, Edges in the poset of partitions of an integer, J. Combin. Theory Ser. A, 48 (1988), 236-238.
- N. J. A. Sloane, Transforms
Crossrefs
First differences are in A024786.
The case of reverse-alternating sum 1 or alternating sum 0 is A000041.
The case of reverse-alternating sum -1 or alternating sum 1 is A000070.
The strict case is A096914.
The case of reverse-alternating sum 2 is A120452.
The case of reverse-alternating sum -2 is A344741.
A001700 counts compositions with alternating sum 2.
A035363 counts partitions into even parts.
A058696 counts partitions of 2n.
A344610 counts partitions by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.
Cf. A006330, A027187, A239830, A306145, A343941, A344607, A344608, A344619, A344650, A344651, A344740.
Shift of A093695.
Programs
-
Maple
with(numtheory): etr:= proc(p) local b; b:=proc(n) option remember; local d,j; if n=0 then 1 else add(add(d*p(d), d=divisors(j)) *b(n-j), j=1..n)/n fi end end: a:= etr(n->`if`(n<3,2,1)): seq(a(n), n=0..40); # Alois P. Heinz, Sep 08 2008
-
Mathematica
CoefficientList[Series[1/((1 - x) (1 - x^2) Product[1 - x^k, {k, 1, 100}]), {x, 0, 100}], x] (* Ben Branman, Mar 07 2012 *) etr[p_] := Module[{b}, b[n_] := b[n] = If[n == 0, 1, Sum[Sum[d*p[d], {d, Divisors[j]}]*b[n - j], {j, 1, n}]/n]; b]; a = etr[If[# < 3, 2, 1]&]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *) (1/((1 - x) (1 - x^2) QPochhammer[x]) + O[x]^50)[[3]] (* Vladimir Reshetnikov, Nov 22 2016 *) Table[Length@IntegerPartitions[n,All,Join[{1,2},Range[n]]],{n,0,15}] (* Robert Price, Jul 28 2020 and Jun 21 2021 *) T[n_, 0] := PartitionsP[n]; T[n_, m_] /; (n >= m (m + 1)/2) := T[n, m] = T[n - m, m - 1] + T[n - m, m]; T[, ] = 0; a[n_] := T[n + 3, 2]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, May 30 2021 *) ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];Table[Length[Select[IntegerPartitions[n],ats[#]==2&]],{n,0,30,2}] (* Gus Wiseman, Jun 21 2021 *)
-
PARI
my(x = 'x + O('x^66)); Vec( 1/((1-x)*(1-x^2)*eta(x)) ) \\ Joerg Arndt, Apr 29 2013
Formula
Euler transform of 2 2 1 1 1 1 1...
G.f.: 1/( (1-x) * (1-x^2) * Product_{k>=1} (1-x^k) ).
a(n) = Sum_{j=0..floor(n/2)} A000070(n-2*j), n>=0.
a(n) ~ sqrt(3) * exp(Pi*sqrt(2*n/3)) / (4*Pi^2) * (1 + 35*Pi/(24*sqrt(6*n))). - Vaclav Kotesovec, Aug 18 2015, extended Nov 05 2016
Extensions
More terms from Pab Ter (pabrlos(AT)yahoo.com), May 04 2004
Edited by Emeric Deutsch, Mar 23 2005
More terms from Franklin T. Adams-Watters, Mar 20 2006
Edited by Charles R Greathouse IV, Apr 20 2010
A344607 Number of integer partitions of n with reverse-alternating sum >= 0.
1, 1, 2, 2, 4, 4, 8, 8, 15, 16, 27, 29, 48, 52, 81, 90, 135, 151, 220, 248, 352, 400, 553, 632, 859, 985, 1313, 1512, 1986, 2291, 2969, 3431, 4394, 5084, 6439, 7456, 9357, 10836, 13479, 15613, 19273, 22316, 27353, 31659, 38558, 44601, 53998, 62416, 75168
Offset: 0
Keywords
Comments
The reverse-alternating sum of a partition (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.
Also the number of reversed integer partitions of n with alternating sum >= 0.
A formula for the reverse-alternating sum of a partition is: (-1)^(k-1) times the number of odd parts in the conjugate partition, where k is the number of parts. So a(n) is the number of integer partitions of n whose conjugate parts are all even or whose length is odd. By conjugation, this is also the number of integer partitions of n whose parts are all even or whose greatest part is odd.
All integer partitions have alternating sum >= 0, so the non-reversed version is A000041.
Examples
The a(1) = 1 through a(8) = 15 partitions: (1) (2) (3) (4) (5) (6) (7) (8) (11) (111) (22) (221) (33) (322) (44) (211) (311) (222) (331) (332) (1111) (11111) (321) (421) (422) (411) (511) (431) (2211) (22111) (521) (21111) (31111) (611) (111111) (1111111) (2222) (3311) (22211) (32111) (41111) (221111) (2111111) (11111111)
Crossrefs
The non-reversed version is A000041.
The odd bisection is A160786.
The complement is counted by A344608.
The even bisection is A344611.
A103919 counts partitions by sum and alternating sum.
A344610 counts partitions by sum and positive reverse-alternating sum.
A344612 counts partitions by sum and reverse-alternating sum.
A344618 gives reverse-alternating sums of standard compositions.
Programs
-
Mathematica
sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}]; Table[Length[Select[IntegerPartitions[n],sats[#]>=0&]],{n,0,30}]
A344610 Triangle read by rows where T(n,k) is the number of integer partitions of 2n with reverse-alternating sum 2k.
1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 5, 5, 3, 1, 1, 7, 9, 6, 3, 1, 1, 11, 14, 12, 6, 3, 1, 1, 15, 23, 20, 12, 6, 3, 1, 1, 22, 34, 35, 21, 12, 6, 3, 1, 1, 30, 52, 56, 38, 21, 12, 6, 3, 1, 1, 42, 75, 91, 62, 38, 21, 12, 6, 3, 1, 1, 56, 109, 140, 103, 63, 38, 21, 12, 6, 3, 1, 1
Offset: 0
Comments
The reverse-alternating sum of a partition (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i. This is equal to (-1)^(k-1) times the number of odd parts in the conjugate partition, where k is the number of parts.
Also the number of reversed integer partitions of 2n with alternating sum 2k.
Examples
Triangle begins: 1 1 1 2 1 1 3 3 1 1 5 5 3 1 1 7 9 6 3 1 1 11 14 12 6 3 1 1 15 23 20 12 6 3 1 1 22 34 35 21 12 6 3 1 1 30 52 56 38 21 12 6 3 1 1 42 75 91 62 38 21 12 6 3 1 1 56 109 140 103 63 38 21 12 6 3 1 1 77 153 215 163 106 63 38 21 12 6 3 1 1 Row n = 5 counts the following partitions: (55) (442) (433) (622) (811) (10) (3322) (541) (532) (721) (4411) (22222) (631) (61111) (222211) (32221) (42211) (331111) (33211) (52111) (22111111) (43111) (4111111) (1111111111) (2221111) (3211111) (211111111)
Crossrefs
Programs
-
Mathematica
sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}]; Table[Length[Select[IntegerPartitions[n],k==sats[#]&]],{n,0,15,2},{k,0,n,2}]
A344611 Number of integer partitions of 2n with reverse-alternating sum >= 0.
1, 2, 4, 8, 15, 27, 48, 81, 135, 220, 352, 553, 859, 1313, 1986, 2969, 4394, 6439, 9357, 13479, 19273, 27353, 38558, 53998, 75168, 104022, 143172, 196021, 267051, 362086, 488733, 656802, 879026, 1171747, 1555997, 2058663, 2714133, 3566122, 4670256, 6096924, 7935184
Offset: 0
Keywords
Comments
The reverse-alternating sum of a partition (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.
Also the number of reversed integer partitions of 2n with alternating sum >= 0.
The reverse-alternating sum of a partition is equal to (-1)^(k-1) times the number of odd parts in the conjugate partition, where k is the number of parts. So a(n) is the number of partitions of 2n whose conjugate parts are all even or whose length is odd. By conjugation, this is also the number of partitions of 2n whose parts are all even or whose greatest part is odd.
Examples
The a(0) = 1 through a(4) = 15 partitions: () (2) (4) (6) (8) (11) (22) (33) (44) (211) (222) (332) (1111) (321) (422) (411) (431) (2211) (521) (21111) (611) (111111) (2222) (3311) (22211) (32111) (41111) (221111) (2111111) (11111111)
Crossrefs
The non-reversed version is A058696 (partitions of 2n).
The ordered version appears to be A114121.
Odd bisection of A344607.
Row sums of A344610.
The strict case is A344650.
A000070 counts partitions with alternating sum 1.
A000097 counts partitions with alternating sum 2.
A103919 counts partitions by sum and alternating sum.
A120452 counts partitions of 2n with reverse-alternating sum 2.
A344618 gives reverse-alternating sums of standard compositions.
A344741 counts partitions of 2n with reverse-alternating sum -2.
Programs
-
Mathematica
sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}]; Table[Length[Select[IntegerPartitions[n],sats[#]>=0&]],{n,0,30,2}]
Formula
Conjecture: a(n) <= A160786(n). The difference is 0, 0, 0, 0, 1, 2, 4, 9, 16, 28, 48, 79, ...
Extensions
More terms from Bert Dobbelaere, Jun 12 2021
A120452 Number of partitions of n-1 boys and one girl with no couple.
1, 1, 3, 5, 9, 14, 23, 34, 52, 75, 109, 153, 216, 296, 407, 549, 739, 981, 1300, 1702, 2224, 2879, 3716, 4761, 6083, 7721, 9774, 12306, 15450, 19307, 24064, 29867, 36978, 45614, 56130, 68846, 84250, 102793, 125148, 151955, 184123, 222553, 268482
Offset: 1
Comments
From Gus Wiseman, Jun 08 2021: (Start)
Also the number of:
- integer partitions of 2n with reverse-alternating sum 2;
- reversed integer partitions of 2n with alternating sum 2;
- integer partitions of 2n with exactly two odd parts, one of which is the greatest;
- odd-length integer partitions of 2n whose conjugate partition has exactly two odd parts.
Note that integer partitions of 2n with alternating or reverse-alternating sum 0 are counted by A000041, ranked by A000290.
(End)
Examples
n=5: If partitions have no pair "o*", then a(5)=9 ("o" means a boy, "*" means a girl): {o, o, o, o, *}, {o, o, *, oo}, {*, oo, oo}, {o, *, ooo}, {o, o, oo*}, {oo, oo*}, {*, oooo}, {o, ooo*}, {oooo*}. From _Gus Wiseman_, Jun 08 2021: (Start) The a(1) = 1 through a(6) = 14 partitions of 2n with reverse-alternating sum 2: (2) (211) (222) (332) (442) (552) (321) (431) (541) (651) (21111) (22211) (22222) (33222) (32111) (32221) (33321) (2111111) (33211) (43221) (43111) (44211) (2221111) (54111) (3211111) (2222211) (211111111) (3222111) (3321111) (4311111) (222111111) (321111111) (21111111111) For example, the partition (43221) has reverse-alternating sum 1 - 2 + 2 - 3 + 4 = 2, so is counted under a(6). The a(1) = 1 through a(6) = 14 partitions of 2n with exactly two odd parts, one of which is the greatest: (11) (31) (33) (53) (55) (75) (51) (71) (73) (93) (321) (332) (91) (111) (521) (532) (543) (3221) (541) (552) (721) (732) (3322) (741) (5221) (921) (32221) (5322) (5421) (7221) (33222) (52221) (322221) (End)
Links
- Vaclav Kotesovec, Table of n, a(n) for n = 1..10000
Crossrefs
A diagonal of A103919.
A diagonal of A344612.
A000097 counts partitions of 2n with alternating sum 2.
A344610 counts partitions of 2n by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.
A344741 counts partitions of 2n with reverse-alternating sum -2.
Programs
-
Mathematica
a[n_] := Total[PartitionsP[Range[0, n-3]]] + PartitionsP[n-1]; Array[a, 50] (* Jean-François Alcover, Jun 05 2021 *)
Formula
a(n) = A000070(n-2) + A002865(n-1). - Fung Cheok Yin (cheokyin_restart(AT)yahoo.com.hk), Aug 15 2006
a(n) ~ exp(Pi*sqrt(2*n/3)) / (2^(3/2)*Pi*sqrt(n)) * (1 - 37*Pi/(24*sqrt(6*n))). - Vaclav Kotesovec, Oct 25 2016
Extensions
More terms from Fung Cheok Yin (cheokyin_restart(AT)yahoo.com.hk), Aug 15 2006
More terms from Max Alekseyev, Aug 23 2006
A026810 Number of partitions of n in which the greatest part is 4.
0, 0, 0, 0, 1, 1, 2, 3, 5, 6, 9, 11, 15, 18, 23, 27, 34, 39, 47, 54, 64, 72, 84, 94, 108, 120, 136, 150, 169, 185, 206, 225, 249, 270, 297, 321, 351, 378, 411, 441, 478, 511, 551, 588, 632, 672, 720, 764, 816, 864, 920, 972, 1033, 1089, 1154, 1215, 1285, 1350
Offset: 0
Comments
Also number of partitions of n into exactly 4 parts.
Also the number of weighted cubic graphs on 4 nodes (=the tetrahedron) with weight n. - R. J. Mathar, Nov 03 2018
From Gus Wiseman, Jun 27 2021: (Start)
Also the number of strict integer partitions of 2n with alternating sum 4, or (by conjugation) partitions of 2n covering an initial interval of positive integers with exactly 4 odd parts. The strict partitions with alternating sum 4 are:
(4) (5,1) (6,2) (7,3) (8,4) (9,5) (10,6)
(5,2,1) (5,3,2) (5,4,3) (6,5,3) (7,6,3)
(6,3,1) (6,4,2) (7,5,2) (8,6,2)
(7,4,1) (8,5,1) (9,6,1)
(6,3,2,1) (6,4,3,1) (6,5,4,1)
(7,4,2,1) (7,4,3,2)
(7,5,3,1)
(8,5,2,1)
(6,4,3,2,1)
(End)
Examples
From _Gus Wiseman_, Jun 27 2021: (Start) The a(4) = 1 through a(10) = 9 partitions of length 4: (1111) (2111) (2211) (2221) (2222) (3222) (3322) (3111) (3211) (3221) (3321) (3331) (4111) (3311) (4221) (4222) (4211) (4311) (4321) (5111) (5211) (4411) (6111) (5221) (5311) (6211) (7111) (End)
References
- G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 275.
- D. E. Knuth, The Art of Computer Programming, vol. 4,fascicle 3, Generating All Combinations and Partitions, Section 7.2.1.4., p. 56, exercise 31.
Links
- Washington Bomfim, Table of n, a(n) for n = 0..10000
- Index entries for linear recurrences with constant coefficients, signature (1,1,0,0,-2,0,0,1,1,-1).
Crossrefs
Programs
-
Magma
[Round((n^3+3*n^2-9*n*(n mod 2))/144): n in [0..60]]; // Vincenzo Librandi, Oct 14 2015
-
Maple
A049347 := proc(n) op(1+(n mod 3),[1,-1,0]) ; end proc: A056594 := proc(n) op(1+(n mod 4),[1,0,-1,0]) ; end proc: A026810 := proc(n) 1/288*(n+1)*(2*n^2+4*n-13+9*(-1)^n) ; %-A049347(n)/9 ; %+A056594(n)/8 ; end proc: # R. J. Mathar, Jul 03 2012
-
Mathematica
Table[Count[IntegerPartitions[n], {4, _}], {n, 0, 60}] LinearRecurrence[{1, 1, 0, 0, -2, 0, 0, 1, 1, -1}, {0, 0, 0, 0, 1, 1, 2, 3, 5, 6}, 60] (* Vincenzo Librandi, Oct 14 2015 *) Table[Length[IntegerPartitions[n, {4}]], {n, 0, 60}] (* Eric Rowland, Mar 02 2017 *) CoefficientList[Series[x^4/Product[1 - x^k, {k, 1, 4}], {x, 0, 60}], x] (* Robert A. Russell, May 13 2018 *)
-
PARI
for(n=0, 60, print(n, " ", round((n^3 + 3*n^2 -9*n*(n % 2))/144))); \\ Washington Bomfim, Jul 03 2012
-
PARI
x='x+O('x^60); concat([0, 0, 0, 0], Vec(x^4/((1-x)*(1-x^2)*(1-x^3)*(1-x^4)))) \\ Altug Alkan, Oct 14 2015
-
PARI
vector(60, n, n--; (n+1)*(2*n^2+4*n-13+9*(-1)^n)/288 + real(I^n)/8 - ((n+2)%3-1)/9) \\ Altug Alkan, Oct 26 2015
-
PARI
print1(0,", "); for(n=1,60,j=0;forpart(v=n,j++,,[4,4]); print1(j,", ")) \\ Hugo Pfoertner, Oct 01 2018
Formula
G.f.: x^4/((1-x)*(1-x^2)*(1-x^3)*(1-x^4)) = x^4/((1-x)^4*(1+x)^2*(1+x+x^2)*(1+x^2)).
a(n+4) = A001400(n). - Michael Somos, Apr 07 2012
a(n) = round( (n^3 + 3*n^2 -9*n*(n mod 2))/144 ). - Washington Bomfim, Jan 06 2021 and Jul 03 2012
From Gregory L. Simay, Oct 13 2015: (Start)
a(n) = (n^3 + 3*n^2 - 9*n)/144 + a(m) - (m^3 + 3*m^2 - 9*m)/144 if n = 12k + m and m is odd. For example, a(23) = a(12*1 + 11) = (23^3 + 3*23^2 - 9*23)/144 + a(11) - (11^3 + 3*11^2 - 9*11)/144 = 94.
a(n) = (n^3 + 3*n^2)/144 + a(m) - (m^3 + 3*m^2)/144 if n = 12k + m and m is even. For example, a(22) = a(12*1 + 10) = (22^3 + 3*22^2)/144 + a(10) - (10^3 + 3*10^2)/144 = 84. (End)
a(n) = A008284(n,4). - Robert A. Russell, May 13 2018
From Gregory L. Simay, Jul 28 2019: (Start)
a(2n+1) = a(2n) + a(n+1) - a(n-3) and
a(2n) = a(2n-1) + a(n+2) - a(n-2). (End)
A357136 Triangle read by rows where T(n,k) is the number of integer compositions of n with alternating sum k = 0..n. Part of the full triangle A097805.
1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 3, 0, 3, 0, 1, 0, 6, 0, 4, 0, 1, 10, 0, 10, 0, 5, 0, 1, 0, 20, 0, 15, 0, 6, 0, 1, 35, 0, 35, 0, 21, 0, 7, 0, 1, 0, 70, 0, 56, 0, 28, 0, 8, 0, 1, 126, 0, 126, 0, 84, 0, 36, 0, 9, 0, 1, 0, 252, 0, 210, 0, 120, 0, 45, 0, 10, 0, 1
Offset: 0
Comments
A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
Examples
Triangle begins: 1 0 1 1 0 1 0 2 0 1 3 0 3 0 1 0 6 0 4 0 1 10 0 10 0 5 0 1 0 20 0 15 0 6 0 1 35 0 35 0 21 0 7 0 1 0 70 0 56 0 28 0 8 0 1 126 0 126 0 84 0 36 0 9 0 1 0 252 0 210 0 120 0 45 0 10 0 1 462 0 462 0 330 0 165 0 55 0 11 0 1 0 924 0 792 0 495 0 220 0 66 0 12 0 1 For example, row n = 5 counts the following compositions: . (32) . (41) . (5) (122) (113) (221) (212) (1121) (311) (2111) (11111)
Crossrefs
The full triangle counting compositions by alternating sum is A097805.
This is the right-half of even-indexed rows of A260492.
The triangle without top row and left column is A108044.
Ranking and counting compositions:
A011782 counts compositions.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
Programs
-
Mathematica
Prepend[Table[If[EvenQ[nn],Prepend[#,0],#]&[Riffle[Table[Binomial[nn,k],{k,Floor[nn/2],nn}],0]],{nn,0,10}],{1}]
Comments
Examples
References
Links
Crossrefs
Programs
Maple
Mathematica
PARI
PARI
PARI
Python
Sage
Formula
Extensions