A349056 Number of weakly alternating permutations of the multiset of prime factors of n.
1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 2, 1, 1, 3, 1, 3, 2, 2, 1, 4, 1, 2, 1, 3, 1, 4, 1, 1, 2, 2, 2, 4, 1, 2, 2, 4, 1, 4, 1, 3, 3, 2, 1, 5, 1, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 6, 1, 2, 3, 1, 2, 4, 1, 3, 2, 4, 1, 6, 1, 2, 3, 3, 2, 4, 1, 5, 1, 2, 1, 6, 2, 2, 2
Offset: 1
Keywords
Examples
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
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.
Programs
-
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}]
Comments