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 A349052 #17 Jan 31 2024 15:51:35 %S A349052 1,1,2,4,8,16,28,52,91,161,280,491,850,1483,2573,4469,7757,13472, %T A349052 23378,40586,70438,122267,212210,368336,639296,1109620,1925916, %U A349052 3342755,5801880,10070133,17478330,30336518,52653939,91389518,158621355,275313226,477850887,829388075 %N A349052 Number of weakly alternating compositions of n. %C A349052 We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. A sequence is alternating iff it is a weakly alternating anti-run. %H A349052 Andrew Howroyd, <a href="/A349052/b349052.txt">Table of n, a(n) for n = 0..1000</a> (Terms 0..55 from Martin Ehrenstein) %e A349052 The a(5) = 16 compositions: %e A349052 (1,1,1,1,1) (1,1,1,2) (1,1,3) (1,4) (5) %e A349052 (1,1,2,1) (1,2,2) (2,3) %e A349052 (1,2,1,1) (1,3,1) (3,2) %e A349052 (2,1,1,1) (2,1,2) (4,1) %e A349052 (2,2,1) %e A349052 (3,1,1) %e A349052 The a(6) = 28 compositions: %e A349052 (111111) (11112) (1113) (114) (15) (6) %e A349052 (11121) (1122) (132) (24) %e A349052 (11211) (1131) (141) (33) %e A349052 (12111) (1212) (213) (42) %e A349052 (21111) (1311) (222) (51) %e A349052 (2121) (231) %e A349052 (2211) (312) %e A349052 (3111) (411) %t A349052 whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}]; %t A349052 Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],whkQ[#]||whkQ[-#]&]],{n,0,10}] %o A349052 (PARI) %o A349052 C(n,f)={my(M=matrix(n,n,j,k,k>=j), s=M[,n]); for(b=1, n, f=!f; M=matrix(n,n,j,k, if(k<j, if(f, M[j-k,k], M[j-k,n]-if(k>1,M[j-k,k-1]) ))); for(k=2, n, M[,k]+=M[,k-1]); s+=M[,n]); s~} %o A349052 seq(n) = concat([1], C(n,0) + C(n,1) - vector(n,j,numdiv(j))) \\ _Andrew Howroyd_, Jan 31 2024 %Y A349052 The strong case is A025047, ranked by A345167. %Y A349052 The directed versions are A129852 and A129853, strong A025048 and A025049. %Y A349052 The complement is counted by A349053, strong A345192. %Y A349052 The version for permutations of prime indices is A349056, strong A345164. %Y A349052 The complement is ranked by A349057, strong A345168. %Y A349052 The version for patterns is A349058, strong A345194. %Y A349052 The multiplicative version is A349059, strong A348610. %Y A349052 An unordered version (partitions) is A349060, complement A349061. %Y A349052 The non-alternating case is A349800, ranked by A349799. %Y A349052 A001250 counts alternating permutations, complement A348615. %Y A349052 A001700 counts compositions of 2n with alternating sum 0. %Y A349052 A003242 counts Carlitz (anti-run) compositions. %Y A349052 A011782 counts compositions. %Y A349052 A106356 counts compositions by number of maximal anti-runs. %Y A349052 A344604 counts alternating compositions with twins. %Y A349052 A345170 counts partitions w/ an alternating permutation, ranked by A345172. %Y A349052 A349054 counts strict alternating compositions. %Y A349052 Cf. A000041, A008965, A102726, A114901, A128761, A261983, A333213, A333755, A344614, A344615, A345165, A345195. %K A349052 nonn %O A349052 0,3 %A A349052 _Gus Wiseman_, Nov 29 2021 %E A349052 a(21)-a(37) from _Martin Ehrenstein_, Jan 08 2022