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.
%I A349051 #21 Jul 07 2022 20:29:33 %S A349051 0,1,5,6,38,41,44,50,553,562,582,593,610,652,664,708,788,808,16966, %T A349051 17036,17048,17172,17192,17449,17458,17542,17676,17712,17940,18000, %U A349051 18513,18530,18593,18626,18968,18992,19496,19536,20625,20676,20769,20868,21256,22600 %N A349051 Numbers k such that the k-th composition in standard order is an alternating permutation of {1..k} for some k. %C A349051 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. %C A349051 A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2). %H A349051 Wikipedia, <a href="https://en.wikipedia.org/wiki/Alternating_permutation">Alternating permutation</a> %F A349051 Equals A333218 (permutation) /\ A345167 (alternating). %e A349051 The sequence together with the corresponding compositions begins: %e A349051 0: () %e A349051 1: (1) %e A349051 5: (2,1) %e A349051 6: (1,2) %e A349051 38: (3,1,2) %e A349051 41: (2,3,1) %e A349051 44: (2,1,3) %e A349051 50: (1,3,2) %e A349051 553: (4,2,3,1) %e A349051 562: (4,1,3,2) %e A349051 582: (3,4,1,2) %e A349051 593: (3,2,4,1) %e A349051 610: (3,1,4,2) %e A349051 652: (2,4,1,3) %e A349051 664: (2,3,1,4) %e A349051 708: (2,1,4,3) %e A349051 788: (1,4,2,3) %e A349051 808: (1,3,2,4) %e A349051 16966: (5,3,4,1,2) %e A349051 17036: (5,2,4,1,3) %t A349051 stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse; %t A349051 wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1]; %t A349051 Select[Range[0,1000],Sort[stc[#]]==Range[Length[stc[#]]]&&wigQ[stc[#]]&] %Y A349051 These permutations are counted by A001250, complement A348615. %Y A349051 Compositions of this type are counted by A025047, complement A345192. %Y A349051 Subset of A333218, which ranks permutations of initial intervals. %Y A349051 Subset of A345167, which ranks alternating compositions, complement A345168. %Y A349051 A003242 counts Carlitz (anti-run) compositions. %Y A349051 A345163 counts normal partitions with an alternating permutation. %Y A349051 A345164 counts alternating permutations of prime indices. %Y A349051 A345170 counts partitions with an alternating permutation. %Y A349051 Compositions in standard order are the rows of A066099: %Y A349051 - Number of parts is given by A000120, distinct A334028. %Y A349051 - Sum and product of parts are given by A070939 and A124758. %Y A349051 - Maximum and minimum parts are given by A333766 and A333768. %Y A349051 - GCD and LCM are given by A326674 and A333226. %Y A349051 - Maximal runs and anti-runs are counted by A124767 and A333381. %Y A349051 - Heinz number is given by A333219. %Y A349051 - Runs-resistance is given by A333628. %Y A349051 - Partitions and strict partitions are ranked by A114994 and A333256. %Y A349051 - Multisets and sets are ranked by A225620 and A333255. %Y A349051 - Strict and constant compositions are ranked by A233564 and A272919. %Y A349051 - Carlitz (anti-run) compositions are ranked by A333489. %Y A349051 Cf. A025048, A025049, A344604, A344615, A344653, A344742, A348377, A348379, A345165. %K A349051 nonn %O A349051 1,3 %A A349051 _Gus Wiseman_, Nov 08 2021