login
Numbers k such that the k-th composition in standard order is not weakly increasing or weakly decreasing.
1

%I #7 Feb 16 2025 08:34:07

%S 13,22,25,27,29,38,41,44,45,46,49,50,51,53,54,55,57,59,61,70,76,77,78,

%T 81,82,83,86,88,89,90,91,92,93,94,97,98,99,101,102,103,105,107,108,

%U 109,110,111,113,114,115,117,118,119,121,123,125,134,140,141,142

%N Numbers k such that the k-th composition in standard order is not weakly increasing or weakly decreasing.

%C The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

%H MathWorld, <a href="https://mathworld.wolfram.com/UnimodalSequence.html">Unimodal Sequence</a>

%F Intersection of A335485 and A335486.

%e The terms and corresponding compositions begin:

%e 13: (1,2,1)

%e 22: (2,1,2)

%e 25: (1,3,1)

%e 27: (1,2,1,1)

%e 29: (1,1,2,1)

%e 38: (3,1,2)

%e 41: (2,3,1)

%e 44: (2,1,3)

%e 45: (2,1,2,1)

%e 46: (2,1,1,2)

%e 49: (1,4,1)

%e 50: (1,3,2)

%e 51: (1,3,1,1)

%e 53: (1,2,2,1)

%e 54: (1,2,1,2)

%e 55: (1,2,1,1,1)

%e 57: (1,1,3,1)

%e 59: (1,1,2,1,1)

%t stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;

%t Select[Range[0,100],!LessEqual@@stc[#]&&!GreaterEqual@@stc[#]&]

%Y The version for run-lengths of compositions is A332833.

%Y Compositions of this type are counted by A332834, complement maybe A329398.

%Y A001523 counts unimodal compositions, ranks too dense.

%Y A011782 counts compositions.

%Y A114994 ranks weakly decreasing compositions, complement A335485.

%Y A115981 counts non-unimodal compositions, ranked by A335373.

%Y A225620 ranks weakly increasing compositions, complement A335486.

%Y A238130, A238279, A333755 count compositions by number of runs.

%Y A332835 counts compositions with weakly incr. or weakly decr. run-lengths.

%Y All of the following pertain to compositions in standard order:

%Y - Length is A000120.

%Y - Sum is A029837(n+1).

%Y - Parts are listed by A066099.

%Y - Number of adjacent equal pairs is A124762, unequal A333382.

%Y - Number of max runs: A124765, A124766, A124767, A124768, A124769, A333381.

%Y - Ranks of strict compositions are A233564.

%Y - Ranks of constant compositions are A272919.

%Y - Anti-runs are ranked by A333489, counted by A003242.

%Y - Run-length transform is A333627, sum A070939.

%Y Cf. A001511, A002051, A065120, A329744, A332745, A332836, A332870, A333218.

%K nonn,changed

%O 1,1

%A _Gus Wiseman_, Sep 18 2024