login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A349799 Numbers k such that the k-th composition in standard order is weakly alternating but has at least two adjacent equal parts. 12
3, 7, 10, 11, 14, 15, 19, 21, 23, 26, 27, 28, 29, 30, 31, 35, 36, 39, 42, 43, 47, 51, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 71, 73, 74, 79, 83, 84, 85, 86, 87, 90, 91, 94, 95, 99, 100, 103, 106, 111, 112, 113, 114, 115, 118, 119, 120, 121, 122, 123, 124, 125 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.

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.

This sequence ranks compositions that are weakly but not strongly alternating.

LINKS

Table of n, a(n) for n=1..62.

Wikipedia, Alternating permutation

FORMULA

Equals A345168 \ A349057 = A348612 \ A349057.

EXAMPLE

The terms and corresponding compositions begin:

   3: (1,1)

   7: (1,1,1)

  10: (2,2)

  11: (2,1,1)

  14: (1,1,2)

  15: (1,1,1,1)

  19: (3,1,1)

  21: (2,2,1)

  23: (2,1,1,1)

  26: (1,2,2)

  27: (1,2,1,1)

  28: (1,1,3)

  29: (1,1,2,1)

  30: (1,1,1,2)

  31: (1,1,1,1,1)

MATHEMATICA

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

whkQ[y_]:=And@@Table[If[EvenQ[m], y[[m]]<=y[[m+1]], y[[m]]>=y[[m+1]]], {m, 1, Length[y]-1}];

Select[Range[0, 100], (whkQ[stc[#]]||whkQ[-stc[#]])&&MatchQ[stc[#], {___, x_, x_, ___}]&]

CROSSREFS

Partitions of this type are counted by A349795, ranked by A350137.

Permutations of prime indices of this type are counted by A349798.

These compositions are counted by A349800.

A001250 = alternating permutations, ranked by A349051, complement A348615.

A003242 = Carlitz (anti-run) compositions, ranked by A333489.

A025047/A025048/A025049 = alternating compositions, ranked by A345167.

A261983 = non-anti-run compositions, ranked by A348612.

A345164 = alternating permutations of prime indices, with twins A344606.

A345165 = partitions without an alternating permutation, ranked by A345171.

A345170 = partitions with an alternating permutation, ranked by A345172.

A345166 = separable partitions with no alternations, ranked by A345173.

A345192 = non-alternating compositions, ranked by A345168.

A345195 = non-alternating anti-run compositions, ranked by A345169.

A349052/A129852/A129853 = weakly alternating compositions.

A349053 = non-weakly alternating compositions, ranked by A349057.

A349056 = weak alternations of prime indices, complement A349797.

A349060 = weak alternations of partitions, complement A349061.

Cf. A005649, A049774, A096441, A128761, A344615, A345163, A349054, A349058, A349796, A349801, A350140.

Sequence in context: A285036 A345168 A348612 * A188081 A188091 A190677

Adjacent sequences:  A349796 A349797 A349798 * A349800 A349801 A349802

KEYWORD

nonn

AUTHOR

Gus Wiseman, Dec 15 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 22 02:18 EDT 2022. Contains 353933 sequences. (Running on oeis4.)