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 A345194 #23 Feb 04 2022 18:09:27 %S A345194 1,1,2,6,22,102,562,3618,26586,219798,2018686,20393790,224750298, %T A345194 2683250082,34498833434,475237879950,6983085189454,109021986683046, %U A345194 1802213242949602,31447143854808378,577609702827987882,11139837273501641502,225075546284489412854 %N A345194 Number of alternating patterns of length n. %C A345194 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 A345194 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). An alternating pattern is necessarily an anti-run (A005649). %C A345194 The version with twins (A344605) is identical to this sequence except with a(2) = 3 instead of 2. %C A345194 From _Gus Wiseman_, Jan 16 2022: (Start) %C A345194 Conjecture: Also the number of weakly up/down patterns of length n, where a sequence is weakly up/down if it is alternately weakly increasing and weakly decreasing, starting with an increase. For example, the a(0) = 1 through a(3) = 6 weakly up/down patterns are: %C A345194 () (1) (1,1) (1,1,1) %C A345194 (2,1) (1,1,2) %C A345194 (2,1,1) %C A345194 (2,1,2) %C A345194 (2,1,3) %C A345194 (3,1,2) %C A345194 (End) %H A345194 Andrew Howroyd, <a href="/A345194/b345194.txt">Table of n, a(n) for n = 0..200</a> %F A345194 a(n) = 2*A350354(n) for n >= 2. - _Andrew Howroyd_, Feb 04 2022 %e A345194 The a(0) = 1 through a(3) = 6 alternating patterns: %e A345194 () (1) (1,2) (1,2,1) %e A345194 (2,1) (1,3,2) %e A345194 (2,1,2) %e A345194 (2,1,3) %e A345194 (2,3,1) %e A345194 (3,1,2) %t A345194 wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1]; %t A345194 allnorm[n_]:=If[n<=0,{{}},Function[s, Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]]; %t A345194 Table[Length[Select[Join@@Permutations/@allnorm[n],wigQ]],{n,0,6}] %o A345194 (PARI) %o A345194 F(p,x) = {sum(k=0, p, (-1)^((k+1)\2)*binomial((p+k)\2, k)*x^k)} %o A345194 R(n,k) = {Vec(if(k==1, x, 2*F(k-2,-x)/F(k-1,x)-2-(k-2)*x) + O(x*x^n))} %o A345194 seq(n)= {concat([1], sum(k=1, n, R(n, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ))} \\ _Andrew Howroyd_, Feb 04 2022 %Y A345194 The version for permutations is A001250, complement A348615. %Y A345194 The version for compositions is A025047, complement A345192. %Y A345194 The version with twins (x,x) is A344605. %Y A345194 The version for perms of prime indices is A345164, complement A350251. %Y A345194 The version for factorizations is A348610, complement A348613, weak A349059. %Y A345194 The weak version is A349058, complement A350138, compositions A349052. %Y A345194 The complement is counted by A350252. %Y A345194 A000670 = patterns, ranked by A333217. %Y A345194 A003242 = anti-run compositions. %Y A345194 A005649 = anti-run patterns, complement A069321. %Y A345194 A019536 = necklace patterns. %Y A345194 A129852 and A129853 = up/down and down/up compositions. %Y A345194 A226316 = patterns avoiding (1,2,3), weakly A052709, complement A335515. %Y A345194 A345170 = partitions w/ alternating permutation, complement A345165. %Y A345194 A349055 = normal multisets w/ alternating permutation, complement A349050. %Y A345194 Cf. A006330, A049774, A128761, A335456, A335457, A335517, A344614, A344615, A345167, A345168. %K A345194 nonn %O A345194 0,3 %A A345194 _Gus Wiseman_, Jun 17 2021 %E A345194 a(10)-a(18) from _Alois P. Heinz_, Dec 10 2021 %E A345194 Terms a(19) and beyond from _Andrew Howroyd_, Feb 04 2022