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 A349058 #19 Jan 14 2024 00:15:19 %S A349058 1,1,3,11,43,203,1123,7235,53171,439595,4037371,40787579,449500595, %T A349058 5366500163,68997666867,950475759899,13966170378907,218043973366091, %U A349058 3604426485899203,62894287709616755,1155219405655975763,22279674547003283003,450151092568978825707 %N A349058 Number of weakly alternating patterns of length n. %C A349058 We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. %C A349058 We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. %H A349058 Andrew Howroyd, <a href="/A349058/b349058.txt">Table of n, a(n) for n = 0..200</a> %e A349058 The a(1) = 1 through a(3) = 11 patterns: %e A349058 (1) (1,1) (1,1,1) %e A349058 (1,2) (1,1,2) %e A349058 (2,1) (1,2,1) %e A349058 (1,2,2) %e A349058 (1,3,2) %e A349058 (2,1,1) %e A349058 (2,1,2) %e A349058 (2,1,3) %e A349058 (2,2,1) %e A349058 (2,3,1) %e A349058 (3,1,2) %t A349058 allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s, y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]]; %t A349058 whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}]; %t A349058 Table[Length[Select[Join@@Permutations/@allnorm[n],whkQ[#]||whkQ[-#]&]],{n,0,6}] %o A349058 (PARI) %o A349058 R(n,k)={my(v=vector(k,i,1), u=vector(n)); for(r=1, n, if(r%2==0, my(s=v[k]); forstep(i=k, 2, -1, v[i] = s - v[i-1]); v[1] = s); for(i=2, k, v[i] += v[i-1]); u[r]=v[k]); u} %o A349058 seq(n)= {concat([1], -vector(n,i,1) + 2*sum(k=1, n, R(n, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ) )} \\ _Andrew Howroyd_, Jan 13 2024 %Y A349058 The strict case is A001250, complement A348615. %Y A349058 The strong case of compositions is A025047, ranked by A345167. %Y A349058 The unordered version is A052955. %Y A349058 The strong case is A345194, with twins A344605. Also the directed case. %Y A349058 The version for compositions is A349052, complement A349053. %Y A349058 The version for permutations of prime indices: A349056, complement A349797. %Y A349058 The version for compositions is ranked by A349057. %Y A349058 The version for ordered factorizations is A349059, strong A348610. %Y A349058 The version for partitions is A349060, complement A349061. %Y A349058 A003242 counts Carlitz (anti-run) compositions. %Y A349058 A005649 counts anti-run patterns. %Y A349058 A344604 counts alternating compositions with twins. %Y A349058 A345163 counts normal partitions with an alternating permutation. %Y A349058 A345170 counts partitions w/ an alternating permutation, complement A345165. %Y A349058 A345192 counts non-alternating compositions, ranked by A345168. %Y A349058 A349055 counts multisets w/ an alternating permutation, complement A349050. %Y A349058 Cf. A049774, A096441, A129852, A129853, A336103, A344614, A344615, A344740, A345164, A348613, A349794. %K A349058 nonn %O A349058 0,3 %A A349058 _Gus Wiseman_, Dec 04 2021 %E A349058 a(9)-a(18) from _Alois P. Heinz_, Dec 10 2021 %E A349058 a(19) onwards from _Andrew Howroyd_, Jan 13 2024