A227038 Number of (weakly) unimodal compositions of n where all parts 1, 2, ..., m appear where m is the largest part.
1, 1, 1, 3, 4, 7, 13, 19, 30, 44, 71, 98, 147, 205, 294, 412, 575, 783, 1077, 1456, 1957, 2634, 3492, 4627, 6082, 7980, 10374, 13498, 17430, 22451, 28767, 36806, 46803, 59467, 75172, 94839, 119285, 149599, 187031, 233355, 290340, 360327, 446222, 551251, 679524, 835964, 1026210
Offset: 0
Keywords
Examples
There are a(8) = 30 such compositions of 8: 01: [ 1 1 1 1 1 1 1 1 ] 02: [ 1 1 1 1 1 1 2 ] 03: [ 1 1 1 1 1 2 1 ] 04: [ 1 1 1 1 2 1 1 ] 05: [ 1 1 1 1 2 2 ] 06: [ 1 1 1 2 1 1 1 ] 07: [ 1 1 1 2 2 1 ] 08: [ 1 1 1 2 3 ] 09: [ 1 1 1 3 2 ] 10: [ 1 1 2 1 1 1 1 ] 11: [ 1 1 2 2 1 1 ] 12: [ 1 1 2 2 2 ] 13: [ 1 1 2 3 1 ] 14: [ 1 1 3 2 1 ] 15: [ 1 2 1 1 1 1 1 ] 16: [ 1 2 2 1 1 1 ] 17: [ 1 2 2 2 1 ] 18: [ 1 2 2 3 ] 19: [ 1 2 3 1 1 ] 20: [ 1 2 3 2 ] 21: [ 1 3 2 1 1 ] 22: [ 1 3 2 2 ] 23: [ 2 1 1 1 1 1 1 ] 24: [ 2 2 1 1 1 1 ] 25: [ 2 2 2 1 1 ] 26: [ 2 2 3 1 ] 27: [ 2 3 1 1 1 ] 28: [ 2 3 2 1 ] 29: [ 3 2 1 1 1 ] 30: [ 3 2 2 1 ] From _Gus Wiseman_, Mar 05 2020: (Start) The a(1) = 1 through a(6) = 13 compositions: (1) (11) (12) (112) (122) (123) (21) (121) (221) (132) (111) (211) (1112) (231) (1111) (1121) (321) (1211) (1122) (2111) (1221) (11111) (2211) (11112) (11121) (11211) (12111) (21111) (111111) (End)
Links
- Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..10000
- Wikipedia, Composition (combinatorics)
- Eric Weisstein's World of Mathematics, Unimodal Sequence
- Wikipedia, Unimodality
Crossrefs
Cf. A001523 (unimodal compositions), A001522 (smooth unimodal compositions with first and last part 1), A001524 (unimodal compositions such that each up-step is by at most 1 and first part is 1).
Organizing by length rather than sum gives A007052.
The complement is counted by A332743.
Compositions covering an initial interval are A107429.
Non-unimodal compositions are A115981.
Programs
-
Maple
b:= proc(n,i) option remember; `if`(i>n, 0, `if`(irem(n, i)=0, 1, 0)+ add(b(n-i*j, i+1)*(j+1), j=1..n/i)) end: a:= n-> `if`(n=0, 1, b(n, 1)): seq(a(n), n=0..60); # Alois P. Heinz, Mar 26 2014
-
Mathematica
b[n_, i_] := b[n, i] = If[i>n, 0, If[Mod[n, i] == 0, 1, 0] + Sum[b[n-i*j, i+1]*(j+1), {j, 1, n/i}]]; a[n_] := If[n==0, 1, b[n, 1]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Apr 09 2015, after Alois P. Heinz *) normQ[m_]:=m=={}||Union[m]==Range[Max[m]]; unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]]; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],normQ[#]&&unimodQ[#]&]],{n,0,10}] (* Gus Wiseman, Mar 05 2020 *)
Formula
a(n) ~ c * exp(Pi*sqrt(r*n)) / n, where r = 0.9409240878664458093345791978063..., c = 0.05518035191234679423222212249... - Vaclav Kotesovec, Mar 04 2020
a(n) + A332743(n) = 2^(n - 1). - Gus Wiseman, Mar 05 2020