OFFSET
1,12
COMMENTS
We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. This sequence counts permutations of prime factors that are weakly but not strongly alternating. Alternating permutations of multisets are a generalization of alternating or up-down permutations of {1..n}.
LINKS
EXAMPLE
Using prime indices instead of factors, the a(n) ordered prime factorizations for selected n are:
n = 4 12 24 48 90 120 192 240 270
------------------------------------------------------------------
11 112 1112 11112 1223 11132 1111112 111132 12232
211 1121 11121 1322 11213 1111121 111213 13222
1211 11211 2213 11312 1111211 111312 21223
2111 12111 2231 21113 1112111 112131 21322
21111 3122 21311 1121111 113121 22132
3221 23111 1211111 121113 22213
31112 2111111 121311 22231
31211 131112 22312
131211 23122
211131 23221
213111 31222
231111 32212
311121
312111
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[-#])&&MatchQ[#, {___, x_, x_, ___}]&]], {n, 100}]
CROSSREFS
This is the weakly but not strictly alternating case of A008480.
Including alternating (in fact, anti-run) permutations gives A349056.
A335452 = anti-run ordered prime factorizations.
A344652 = ordered prime factorizations w/o weakly increasing triples.
A349797 = non-weakly alternating ordered prime factorizations.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 14 2021
STATUS
approved
