cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A227038 Number of (weakly) unimodal compositions of n where all parts 1, 2, ..., m appear where m is the largest part.

This page as a plain text file.
%I A227038 #39 Feb 16 2025 08:33:20
%S A227038 1,1,1,3,4,7,13,19,30,44,71,98,147,205,294,412,575,783,1077,1456,1957,
%T A227038 2634,3492,4627,6082,7980,10374,13498,17430,22451,28767,36806,46803,
%U A227038 59467,75172,94839,119285,149599,187031,233355,290340,360327,446222,551251,679524,835964,1026210
%N A227038 Number of (weakly) unimodal compositions of n where all parts 1, 2, ..., m appear where m is the largest part.
%H A227038 Joerg Arndt and Alois P. Heinz, <a href="/A227038/b227038.txt">Table of n, a(n) for n = 0..10000</a>
%H A227038 Wikipedia, <a href="https://en.wikipedia.org/wiki/Composition_(combinatorics)">Composition (combinatorics)</a>
%H A227038 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/UnimodalSequence.html">Unimodal Sequence</a>
%H A227038 Wikipedia, <a href="https://en.wikipedia.org/wiki/Unimodality">Unimodality</a>
%F A227038 a(n) ~ c * exp(Pi*sqrt(r*n)) / n, where r = 0.9409240878664458093345791978063..., c = 0.05518035191234679423222212249... - _Vaclav Kotesovec_, Mar 04 2020
%F A227038 a(n) + A332743(n) = 2^(n - 1). - _Gus Wiseman_, Mar 05 2020
%e A227038 There are a(8) = 30 such compositions of 8:
%e A227038 01:  [ 1 1 1 1 1 1 1 1 ]
%e A227038 02:  [ 1 1 1 1 1 1 2 ]
%e A227038 03:  [ 1 1 1 1 1 2 1 ]
%e A227038 04:  [ 1 1 1 1 2 1 1 ]
%e A227038 05:  [ 1 1 1 1 2 2 ]
%e A227038 06:  [ 1 1 1 2 1 1 1 ]
%e A227038 07:  [ 1 1 1 2 2 1 ]
%e A227038 08:  [ 1 1 1 2 3 ]
%e A227038 09:  [ 1 1 1 3 2 ]
%e A227038 10:  [ 1 1 2 1 1 1 1 ]
%e A227038 11:  [ 1 1 2 2 1 1 ]
%e A227038 12:  [ 1 1 2 2 2 ]
%e A227038 13:  [ 1 1 2 3 1 ]
%e A227038 14:  [ 1 1 3 2 1 ]
%e A227038 15:  [ 1 2 1 1 1 1 1 ]
%e A227038 16:  [ 1 2 2 1 1 1 ]
%e A227038 17:  [ 1 2 2 2 1 ]
%e A227038 18:  [ 1 2 2 3 ]
%e A227038 19:  [ 1 2 3 1 1 ]
%e A227038 20:  [ 1 2 3 2 ]
%e A227038 21:  [ 1 3 2 1 1 ]
%e A227038 22:  [ 1 3 2 2 ]
%e A227038 23:  [ 2 1 1 1 1 1 1 ]
%e A227038 24:  [ 2 2 1 1 1 1 ]
%e A227038 25:  [ 2 2 2 1 1 ]
%e A227038 26:  [ 2 2 3 1 ]
%e A227038 27:  [ 2 3 1 1 1 ]
%e A227038 28:  [ 2 3 2 1 ]
%e A227038 29:  [ 3 2 1 1 1 ]
%e A227038 30:  [ 3 2 2 1 ]
%e A227038 From _Gus Wiseman_, Mar 05 2020: (Start)
%e A227038 The a(1) = 1 through a(6) = 13 compositions:
%e A227038   (1)  (11)  (12)   (112)   (122)    (123)
%e A227038              (21)   (121)   (221)    (132)
%e A227038              (111)  (211)   (1112)   (231)
%e A227038                     (1111)  (1121)   (321)
%e A227038                             (1211)   (1122)
%e A227038                             (2111)   (1221)
%e A227038                             (11111)  (2211)
%e A227038                                      (11112)
%e A227038                                      (11121)
%e A227038                                      (11211)
%e A227038                                      (12111)
%e A227038                                      (21111)
%e A227038                                      (111111)
%e A227038 (End)
%p A227038 b:= proc(n,i) option remember;
%p A227038       `if`(i>n, 0, `if`(irem(n, i)=0, 1, 0)+
%p A227038       add(b(n-i*j, i+1)*(j+1), j=1..n/i))
%p A227038     end:
%p A227038 a:= n-> `if`(n=0, 1, b(n, 1)):
%p A227038 seq(a(n), n=0..60);  # _Alois P. Heinz_, Mar 26 2014
%t A227038 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_ *)
%t A227038 normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
%t A227038 unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
%t A227038 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],normQ[#]&&unimodQ[#]&]],{n,0,10}] (* _Gus Wiseman_, Mar 05 2020 *)
%Y A227038 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).
%Y A227038 Organizing by length rather than sum gives A007052.
%Y A227038 The complement is counted by A332743.
%Y A227038 The case of run-lengths of partitions is A332577, with complement A332579.
%Y A227038 Compositions covering an initial interval are A107429.
%Y A227038 Non-unimodal compositions are A115981.
%Y A227038 Cf. A000009, A055932, A072704, A317086, A329766, A332578, A332669, A332670.
%K A227038 nonn
%O A227038 0,4
%A A227038 _Joerg Arndt_, Jun 28 2013