OFFSET
1,12
COMMENTS
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).
EXAMPLE
The a(n) permutations for selected n:
n = 4 12 24 48 60 72 90 96 120
----------------------------------------------------------------
22 223 2223 22223 2235 22233 2335 222223 22235
322 2232 22232 2253 22323 2353 222232 22253
2322 22322 2352 22332 2533 222322 22325
3222 23222 2532 23223 3235 223222 22352
32222 3225 23322 3325 232222 22523
3522 32223 3352 322222 22532
5223 32232 3532 23225
5322 32322 5233 23522
33222 5323 25223
5332 25322
32225
32252
32522
35222
52223
52232
52322
53222
MATHEMATICA
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]] ==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[Permutations[Flatten[ ConstantArray@@@FactorInteger[n]]], !wigQ[#]&]], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 08 2022
STATUS
approved