Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #64 Mar 29 2021 15:09:51
%S 1,0,1,2,4,6,11,16,27,40,63,92,141,202,299,426,614,862,1222,1694,2362,
%T 3242,4456,6054,8229,11072,14891,19872,26477,35050,46320,60866,79827,
%U 104194,135703,176008,227791,293702,377874,484554,620011,790952,1006924
%N Number of unimodal compositions of n+2 where the maximal part appears exactly twice.
%C Old name was: Expansion of a q-series.
%C a(n) is also the number of 2-colored partitions of n with the same number of parts in each color. - _Shishuo Fu_, May 30 2017
%C From _Gus Wiseman_, Mar 25 2021: (Start)
%C Also the number of even-length compositions of n with alternating parts weakly decreasing. Allowing odd lengths also gives A342528. The version with alternating parts strictly decreasing appears to be A064428. The a(2) = 1 through a(7) = 16 compositions are:
%C (1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
%C (2,1) (2,2) (2,3) (2,4) (2,5)
%C (3,1) (3,2) (3,3) (3,4)
%C (1,1,1,1) (4,1) (4,2) (4,3)
%C (1,2,1,1) (5,1) (5,2)
%C (2,1,1,1) (1,2,1,2) (6,1)
%C (1,3,1,1) (1,3,1,2)
%C (2,1,2,1) (1,4,1,1)
%C (2,2,1,1) (2,2,1,2)
%C (3,1,1,1) (2,2,2,1)
%C (1,1,1,1,1,1) (2,3,1,1)
%C (3,1,2,1)
%C (3,2,1,1)
%C (4,1,1,1)
%C (1,2,1,1,1,1)
%C (2,1,1,1,1,1)
%C (End)
%H Alois P. Heinz, <a href="/A114921/b114921.txt">Table of n, a(n) for n = 0..10000</a>
%H S. Fu and D. Tang, <a href="https://arxiv.org/abs/1705.10067">On a generalized crank for k-colored partitions</a>, arXiv:1705.10067 [math.CO], 2017.
%H B. Kim and J. Lovejoy, <a href="https://doi.org/10.1007/s00026-015-0281-x">Ramanujan-type partial theta identities and rank differences for special unimodal sequences</a>, Annals of Combinatorics, 19 (2015), 705-733.
%F G.f.: 1 + Sum_{k>0} (x^k / ((1-x)(1-x^2)...(1-x^k)))^2 = (1 + Sum_{k>0} 2 (-1)^k x^((k^2+k)/2) ) / (Product_{k>0} (1 - x^k))^2.
%F G.f.: 1 + x*(1 - G(0))/(1-x) where G(k) = 1 - x/(1-x^(k+1))^2/(1-x/(x-1/G(k+1) )); (continued fraction). - _Sergei N. Gladkovskii_, Jan 23 2013
%F a(n) = A006330(n) - A001523(n). - _Vaclav Kotesovec_, Jun 22 2015
%F a(n) ~ Pi * exp(2*Pi*sqrt(n/3)) / (16 * 3^(5/4) * n^(7/4)). - _Vaclav Kotesovec_, Oct 24 2018
%e From _Joerg Arndt_, Jun 10 2013: (Start)
%e There are a(7)=16 such compositions of 7+2=9 where the maximal part appears twice:
%e 01: [ 1 1 1 1 1 2 2 ]
%e 02: [ 1 1 1 1 2 2 1 ]
%e 03: [ 1 1 1 2 2 1 1 ]
%e 04: [ 1 1 1 3 3 ]
%e 05: [ 1 1 2 2 1 1 1 ]
%e 06: [ 1 1 3 3 1 ]
%e 07: [ 1 2 2 1 1 1 1 ]
%e 08: [ 1 2 3 3 ]
%e 09: [ 1 3 3 1 1 ]
%e 10: [ 1 3 3 2 ]
%e 11: [ 1 4 4 ]
%e 12: [ 2 2 1 1 1 1 1 ]
%e 13: [ 2 3 3 1 ]
%e 14: [ 3 3 1 1 1 ]
%e 15: [ 3 3 2 1 ]
%e 16: [ 4 4 1 ]
%e (End)
%t max = 50; s = (1+Sum[2*(-1)^k*q^(k(k+1)/2), {k, 1, max}])/QPochhammer[q]^2+ O[q]^max; CoefficientList[s, q] (* _Jean-François Alcover_, Nov 30 2015, from 1st g.f. *)
%t wdw[q_]:=And@@Table[q[[i]]>=q[[i+2]],{i,Length[q]-2}];
%t Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],EvenQ[Length[#]]&],wdw]],{n,0,15}] (* _Gus Wiseman_, Mar 25 2021 *)
%o (PARI) {a(n) = if( n<0, 0, polcoeff( sum(k=0, n\2, x^(2*k) / prod(i=1, k, 1 - x^i, 1 + x * O(x^n))^2), n))};
%o (PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( sum(k=1, sqrtint(8*n + 1)\2, 2*(-1)^k * x^((k^2+k)/2), 1 + A) / eta(x + A)^2, n))};
%Y Cf. A226541 (max part appears three times), A188674 (max part m appears m times), A001523 (max part appears any number of times).
%Y Column k=2 of A247255.
%Y A000041 counts weakly increasing (or weakly decreasing) compositions.
%Y A000203 adds up divisors.
%Y A002843 counts compositions with all adjacent parts x <= 2y.
%Y A003242 counts anti-run compositions.
%Y A034008 counts even-length compositions.
%Y A065608 counts even-length compositions with alternating parts equal.
%Y A342528 counts compositions with alternating parts weakly decreasing.
%Y A342532 counts even-length compositions with alternating parts unequal.
%Y Cf. A000726, A001522, A008965, A062968, A064410, A064428, A069916, A070211, A175342, A224958, A342495, A342527.
%K nonn
%O 0,4
%A _Michael Somos_, Jan 07 2006
%E New name from _Joerg Arndt_, Jun 10 2013