read n k m h[1]= for((j=2;n>1;)){ ((j*j>n&&(j=n),n%j?++j:!(n/=j)))||{ for a in ${!h[@]};{ for((i=k;i--&&(a*=j)<=m;)){ h[a]= } } } } echo ${#h[@]}