ÆFµSṪ_LÆfI¬S
Try it online!Try it online!
ÆFµSṪ_L
ÆF Compute prime factorization as [prime, exponent] pairs.
µ Start a new monadic chain whose argument is above.
S Vectorized sum (sum of primes, sum of exponents).
Ṫ Last element (sum of exponents).
_ Above minus below.
L Length (of the [prime, exponent] pairs).
Alternative
ÆfµQLạL
Try it online! Port of Luis Mendo's answer in MATL.
ÆfµQLạLÆfI¬S
Æf Compute the array of primes whose product is z.
µ Start a new monadic chain whose argument isImplicit aboveinput.
Q Obtain Uniqueprime elementsfactors, sorted byand firstwith appearance.repetitions
LI Consecutive Length.differences
ạ ¬ Above absolute_differenceLogical below.
negate: zeros become 1, nonzeros become L0
Length (ofS the [prime,Sum. exponent]Implicit pairs).display