OFFSET
1,6
COMMENTS
We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. Then a sequence is alternating in the sense of A025047 iff it is a weakly alternating anti-run.
EXAMPLE
The following are the weakly alternating permutations for selected n:
n = 2 6 12 24 48 60 90 120 180
----------------------------------------------------------
2 23 223 2223 22223 2253 2335 22253 22335
32 232 2232 22232 2325 2533 22325 22533
322 2322 22322 2523 3253 22523 23253
3222 23222 3252 3325 23252 23352
32222 3522 3352 25232 25233
5232 3523 32225 25332
5233 32522 32325
5332 35222 32523
52223 33252
52322 33522
35232
52323
53322
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
whkQ[y_]:=And@@Table[If[EvenQ[m], y[[m]]<=y[[m+1]], y[[m]]>=y[[m+1]]], {m, 1, Length[y]-1}];
Table[Length[Select[Permutations[primeMS[n]], whkQ[#]||whkQ[-#]&]], {n, 100}]
CROSSREFS
Counting all permutations of prime factors gives A008480.
The variation counting anti-run permutations is A335452.
The complement is counted by A349797.
The non-alternating case is A349798.
A003242 counts Carlitz (anti-run) compositions.
A348379 counts factorizations with an alternating permutation.
A349800 counts weakly but not strongly alternating compositions.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 02 2021
STATUS
approved