login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A227038 Number of (weakly) unimodal compositions of n where all parts 1, 2, ..., m appear where m is the largest part. 29
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..10000

Wikipedia, Composition (combinatorics)

Wikipedia, Unimodality

Eric Weisstein's World of Mathematics, Unimodal Sequence

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

EXAMPLE

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)

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 *)

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.

The case of run-lengths of partitions is A332577, with complement A332579.

Compositions covering an initial interval are A107429.

Non-unimodal compositions are A115981.

Cf. A000009, A055932, A072704, A317086, A329766, A332578, A332669, A332670.

Sequence in context: A089374 A029552 A193883 * A189994 A125118 A310008

Adjacent sequences:  A227035 A227036 A227037 * A227039 A227040 A227041

KEYWORD

nonn

AUTHOR

Joerg Arndt, Jun 28 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 7 01:11 EDT 2020. Contains 333291 sequences. (Running on oeis4.)