login
Number of unimodal partitions/compositions of n into distinct terms.
42

%I #36 Dec 31 2019 16:38:47

%S 1,1,1,3,3,5,9,11,15,21,33,39,55,69,93,127,159,201,261,327,411,537,

%T 653,819,1011,1257,1529,1899,2331,2829,3441,4179,5031,6093,7305,8767,

%U 10575,12573,14997,17847,21223,25089,29757,35055,41379,48801,57285,67131

%N Number of unimodal partitions/compositions of n into distinct terms.

%C Also the number of ways to partition a strict integer partition of n into two unordered blocks. - _Gus Wiseman_, Dec 31 2019

%H Alois P. Heinz, <a href="/A072706/b072706.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = sum_k A072705(n, k) = A032020(n)-A072707(k) = A032302(n)/2 (n>0).

%F G.f.: 1/2*(1+Product_{k>0} (1+2*x^k)). - _Vladeta Jovovic_, Jun 24 2003

%F G.f.: 1 + sum(n>=1, 2^(n-1)*q^(n*(n+1)/2) / prod(k=1..n, 1-q^k ) ). [_Joerg Arndt_, Jan 20 2014]

%F a(n) ~ c^(1/4) * exp(2*sqrt(c*n)) / (4*sqrt(3*Pi)*n^(3/4)), where c = -polylog(2, -2) = A266576 = 1.436746366883680946362902023893583354... - _Vaclav Kotesovec_, Sep 22 2019

%e a(6)=9 since 6 can be written as 1+2+3, 1+3+2, 1+5, 2+3+1, 2+4, 3+2+1, 4+2, 5+1, or 6, but not for example 1+4+1 (which does not have distinct terms) nor 2+1+3 (which is not unimodal).

%e From _Joerg Arndt_, Mar 25 2014: (Start)

%e The a(10) = 33 such compositions of 10 are:

%e 01: [ 1 2 3 4 ]

%e 02: [ 1 2 4 3 ]

%e 03: [ 1 2 7 ]

%e 04: [ 1 3 4 2 ]

%e 05: [ 1 3 6 ]

%e 06: [ 1 4 3 2 ]

%e 07: [ 1 4 5 ]

%e 08: [ 1 5 4 ]

%e 09: [ 1 6 3 ]

%e 10: [ 1 7 2 ]

%e 11: [ 1 9 ]

%e 12: [ 2 3 4 1 ]

%e 13: [ 2 3 5 ]

%e 14: [ 2 4 3 1 ]

%e 15: [ 2 5 3 ]

%e 16: [ 2 7 1 ]

%e 17: [ 2 8 ]

%e 18: [ 3 4 2 1 ]

%e 19: [ 3 5 2 ]

%e 20: [ 3 6 1 ]

%e 21: [ 3 7 ]

%e 22: [ 4 3 2 1 ]

%e 23: [ 4 5 1 ]

%e 24: [ 4 6 ]

%e 25: [ 5 3 2 ]

%e 26: [ 5 4 1 ]

%e 27: [ 6 3 1 ]

%e 28: [ 6 4 ]

%e 29: [ 7 2 1 ]

%e 30: [ 7 3 ]

%e 31: [ 8 2 ]

%e 32: [ 9 1 ]

%e 33: [ 10 ]

%e (End)

%p b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,

%p expand(b(n, i-1) +`if`(i>n, 0, x*b(n-i, i-1)))))

%p end:

%p a:= n->(p->add(coeff(p, x, i)*ceil(2^(i-1)), i=0..degree(p)))(b(n$2)):

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Mar 25 2014

%t 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, x*b[n - i, i - 1]]]]]; a[n_] := Function[{p}, Sum[Coefficient[p, x, i]*Ceiling[2^(i - 1)], {i, 0, Exponent[p, x]}]][b[n, n]]; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Jan 16 2015, after _Alois P. Heinz_ *)

%t Table[If[n==0,1,Sum[2^(Length[ptn]-1),{ptn,Select[IntegerPartitions[n],UnsameQ@@#&]}]],{n,0,15}] (* _Gus Wiseman_, Dec 31 2019 *)

%o (PARI) N=66; q='q+O('q^N); Vec( 1 + sum(n=1, N, 2^(n-1)*q^(n*(n+1)/2) / prod(k=1, n, 1-q^k ) ) ) \\ _Joerg Arndt_, Mar 25 2014

%Y The non-strict version is A001523.

%Y Cf. A000009, A000041, A001970, A032020, A059618, A072705, A072707, A270995, A294617.

%K nonn

%O 0,4

%A _Henry Bottomley_, Jul 04 2002