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 A344605 #13 Nov 15 2021 01:17:10 %S A344605 1,1,3,6,22,102,562,3618,26586,219798,2018686,20393790,224750298, %T A344605 2683250082,34498833434,475237879950,6983085189454,109021986683046, %U A344605 1802213242949602,31447143854808378,577609702827987882,11139837273501641502,225075546284489412854 %N A344605 Number of alternating patterns of length n, including pairs (x,x). %C A344605 We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670. A sequence is alternating (cf. A025047) including pairs (x,x) if there are no adjacent triples (..., x, y, z, ...) where x <= y <= z or x >= y >= z. These sequences avoid the weak consecutive patterns (1,2,3) and (3,2,1). %C A344605 An alternating pattern of length > 2 is necessarily an anti-run (A005649). %C A344605 The version without pairs (x,x) is identical to this sequence except a(2) = 2 instead of 3. %H A344605 Martin Ehrenstein, <a href="/A344605/b344605.txt">Table of n, a(n) for n = 0..25</a> %e A344605 The a(0) = 1 through a(4) = 22 patterns: %e A344605 () (1) (1,1) (1,2,1) (1,2,1,2) %e A344605 (1,2) (1,3,2) (1,2,1,3) %e A344605 (2,1) (2,1,2) (1,3,1,2) %e A344605 (2,1,3) (1,3,2,3) %e A344605 (2,3,1) (1,3,2,4) %e A344605 (3,1,2) (1,4,2,3) %e A344605 (2,1,2,1) %e A344605 (2,1,3,1) %e A344605 (2,1,3,2) %e A344605 (2,1,4,3) %e A344605 (2,3,1,2) %e A344605 (2,3,1,3) %e A344605 (2,3,1,4) %e A344605 (2,4,1,3) %e A344605 (3,1,2,1) %e A344605 (3,1,3,2) %e A344605 (3,1,4,2) %e A344605 (3,2,3,1) %e A344605 (3,2,4,1) %e A344605 (3,4,1,2) %e A344605 (4,1,3,2) %e A344605 (4,2,3,1) %t A344605 allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]]; %t A344605 Table[Length[Select[Join@@Permutations/@allnorm[n],!MatchQ[#,{___,x_,y_,z_,___}/;x<=y<=z||x>=y>=z]&]],{n,0,6}] %Y A344605 The version for permutations is A001250. %Y A344605 The version for compositions is A344604. %Y A344605 The version for permutations of prime indices is A344606. %Y A344605 A000670 counts patterns (ranked by A333217). %Y A344605 A003242 counts anti-run compositions. %Y A344605 A005649 counts anti-run patterns. %Y A344605 A019536 counts necklace patterns. %Y A344605 A025047 counts alternating or wiggly compositions, complement A345192. %Y A344605 A226316 counts patterns avoiding (1,2,3) (weakly: A052709). %Y A344605 A335515 counts patterns matching (1,2,3). %Y A344605 Cf. A000041, A006330, A049774, A102726, A103919, A124754, A128761, A335456, A335457, A335517, A344612, A344614, A344615, A348377. %K A344605 nonn %O A344605 0,3 %A A344605 _Gus Wiseman_, May 27 2021 %E A344605 a(10) and beyond from _Martin Ehrenstein_, Jun 10 2021