OFFSET
1,8
COMMENTS
a(n) = 0 iff n has separable prime factors (A335433). A multiset is separable iff it has a permutation that is an anti-run (meaning there are no adjacent equal parts).
EXAMPLE
The runs of the 4 permutations of the prime factors of 24 are:
((2,2,2),(3))
((2,2),(3),(2))
((2),(3),(2,2))
((3),(2,2,2))
The longest have length 3, so a(24) = 4 - 3 = 1.
MATHEMATICA
prifacs[n_]:=If[n==1, {}, Flatten[ConstantArray@@@FactorInteger[n]]];
Table[PrimeOmega[n]-Max@@Table[Length[Split[y]], {y, Permutations[prifacs[n]]}], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jul 07 2024
STATUS
approved