Returns the number of prime factors of n.
r = number_multiprimality ( n )
a r-by-c matrix of floating point integers
a r-by-c matrix of floating point integers
Returns the number of prime factors, not necessarily distinct, of n.
number_multiprimality ( 4 ) // 2 // This function is vectorized number_multiprimality ( 1:20 ) expected = [1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 4, 1, 3, 1, 3] // Plot it scf(); n = 1:100; r = number_multiprimality ( n ); plot(n,r) xtitle("Multiprimality","n","Number of non-distinct prime factors")
http://mathworld.wolfram.com/PrimeFactor.html