Function to calculate count of distinct prime factors of a number
function countOfPrimefactors ( CountDistinct ) { let MAX = 1000000 ; let prime = Array ( MAX + 1 ) ; for ( let i = 0 ; i <= MAX ; i ++ ) { CountDistinct [ i ] = 0 ; prime [ i ] = true ; }