A349053 Number of non-weakly alternating integer compositions of n.
0, 0, 0, 0, 0, 0, 4, 12, 37, 95, 232, 533, 1198, 2613, 5619, 11915, 25011, 52064, 107694, 221558, 453850, 926309, 1884942, 3825968, 7749312, 15667596, 31628516, 63766109, 128415848, 258365323, 519392582, 1043405306, 2094829709, 4203577778, 8431313237, 16904555958
Offset: 0
Keywords
Examples
The a(6) = 12 compositions: (1,1,2,2,1) (1,1,2,3) (1,2,4) (1,2,1,1,2) (1,2,3,1) (4,2,1) (1,2,2,1,1) (1,3,2,1) (2,1,1,2,1) (2,1,1,3) (3,1,1,2) (3,2,1,1)
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..1000 (terms 0..55 from Martin Ehrenstein)
- Wikipedia, Alternating permutation
Crossrefs
The strong version is A345192.
The complement is counted by A349052.
The version for ordered factorizations is A350139.
A001700 counts compositions of 2n with alternating sum 0.
A003242 counts Carlitz (anti-run) compositions.
A106356 counts compositions by number of maximal anti-runs.
A344604 counts alternating compositions with twins.
A345164 counts alternating ordered prime factorizations.
A349054 counts strict alternating compositions.
Programs
-
Mathematica
wwkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}]||And@@Table[If[EvenQ[m],y[[m]]>=y[[m+1]],y[[m]]<=y[[m+1]]],{m,1,Length[y]-1}]; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!wwkQ[#]&]],{n,0,10}]
Extensions
a(21)-a(35) from Martin Ehrenstein, Jan 08 2022
Comments