OFFSET
0,4
COMMENTS
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.
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).
Conjecture: Also the number of non-weakly up/down (or down/up) patterns of length n. For example:
- The a(3) = 7 non-weakly up/down patterns:
(121), (122), (123), (132), (221), (231), (321)
- The a(3) = 7 non-weakly down/up patterns:
(112), (123), (211), (212), (213), (312), (321)
- The a(3) = 7 non-alternating patterns (see example for more):
(111), (112), (122), (123), (211), (221), (321)
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..200
EXAMPLE
The a(2) = 1 and a(3) = 7 non-alternating patterns:
(1,1) (1,1,1)
(1,1,2)
(1,2,2)
(1,2,3)
(2,1,1)
(2,2,1)
(3,2,1)
The a(4) = 53 non-alternating patterns:
2112 3124 4123 1112 2134 1234 3112 2113 1123
2211 3214 4213 1211 2314 1243 3123 2123 1213
2212 3412 4312 1212 2341 1324 3211 2213 1223
3421 4321 1221 2413 1342 3212 2311 1231
1222 2431 1423 3213 2312 1232
1432 3312 2313 1233
3321 2321 1312
2331 1321
1322
1323
1332
MATHEMATICA
allnorm[n_]:=If[n<=0, {{}}, Function[s, Array[Count[s, y_/; y<=#]+1&, n]]/@Subsets[Range[n-1]+1]];
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]]==Length[y]&& Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[Join@@Permutations/@allnorm[n], !wigQ[#]&]], {n, 0, 6}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 13 2022
EXTENSIONS
Terms a(9) and beyond from Andrew Howroyd, Feb 04 2022
STATUS
approved