g | x | w | all
Bytes Lang Time Link
031Wolfram Language Mathematica190503T043817Zatt
010Husk201030T155516ZLegionMa
009Gaia190502T151201ZGiuseppe
052Wolfram Language Mathematica190502T140556ZZaMoC
00905AB1E190502T135824ZEmigna
077Scala190503T092422ZPeter
008Brachylog190503T000634ZUnrelate
034Ruby190502T221649ZValue In
054C# Visual C# Interactive Compiler190502T181908ZGymhgy
015Clam190502T172538ZMayube
013Japt h190502T163905ZGymhgy
009Jelly190502T141348Zhyper-ne
039Javascript ES6190502T145618Zuser8371
038Perl 6190502T143514ZJo King

Wolfram Language (Mathematica), 38 35 31 bytes

If[i∣n,n/=i;1,0]~Sum~{i,n=#}&

Try it online!

Greedy algorithm. Times out on TIO on larger inputs such as 1099511627776.

Husk, 10 bytes

▲mLfo=¹ΠṖḊ

Try it online! A port of Emigna's answer.

Gaia, 10 9 bytes

Π=
dz↑⁇(l

Try it online!

Follows the same "algorithm" as seen elsewhere -- filter the divisor powerset for the longest with product equal to the number and return its length.

	| helper function
Π=	| is prod(list)==n (implicit)?
	|
	| main function; implicitly takes n
dz	| divisor powerset (in decreasing order of size)
  ↑⁇	| filter by helper function
    (l	| take the first element and take the length (implicitly output)

Wolfram Language (Mathematica), 52 bytes

Max[Length/@Cases[Subsets@Divisors@#,{a__}/;1a==#]]&

Try it online!

4-bytes saved thanks to @attinat

Here is also a 153 bytes version that calculates 1099511627776 and 10^15

Max[Length/@Table[s=RandomSample@Flatten[Table@@@FactorInteger[#]];Last@Select[Times@@@TakeList[s,#]&/@IntegerPartitions@Length@s,DuplicateFreeQ],5!]]+1&      

Try it online!

The result for 10^15 is 12

{1, 2, 4, 5, 10, 16, 25, 40, 50, 100, 125, 250}

05AB1E, 9 bytes

Very inefficient. Will time out on TIO for numbers with a large amount of divisors.

ÑæʒPQ}€gZ

Try it online!

Explanation

Ñ          # push a list of divisors of the input
 æ         # push the powerset of that list
  ʒPQ}     # filter, keep only the lists whose product is the input
      €g   # get the length of each
        Z  # take the maximum

Scala, 77 bytes

def f(n:Long)={var(m,c,i)=(n,1,2L);while(i<=m){if(m%i==0){m/=i;c+=1};i+=1};c}

Try it online!

Brachylog, 8 bytes

f;?⟨⊇×⟩l

Try it online!

(The naive approach, {~×≠l}ᶠ⌉, generates an infinite number of solutions with extra 1s before eliminating them with , and thus fails to actually terminate. It's not a problem, though, since it's for the same byte count!)

Takes input through the input variable and output through the output variable. The header on TIO contains a copy of most of the code for the sake of showing you what the factor list is, but this works perfectly fine without it. Since gives larger sublists first, this predicate essentially does the same thing as most other answers, but without explicitly generating and filtering the complete powerset of the factors, thanks to backtracking.

            The output
       l    is the length of
    ⊇       a sublist (the largest satisfying these constraints)
f           of the factors of
            the input
 ; ⟨  ⟩     which
     ×      with its elements multiplied together
  ?         is the input.

Ruby, 34 bytes

Obviously times out on that massive number, but will eventually time out if given enough time on another machine.

->n{(1..n).count{|e|n%e<1?n/=e:p}}

Try it online!

C# (Visual C# Interactive Compiler), 54 bytes

int f(int n,int i=0)=>n%++i<1?1+f(n/i,i):n>i?f(n,i):0;

Uses the same approach as @vrugtehagel's and @JoKing's answers.

Try it online!

Clam, 15 bytes

p}_`nq#:;qQ@s~Q

TIO link coming soon (when dennis pulls)

Basically a port of @Emigna's 05AB1E solution.

Explanation

                - Implicit Q = first input
p               - Print...
 }              - The last element of...
  _             - Sorted...
   `nq          - Lengths of... (map q => q.len)
           @s   - Items in powerset of
             ~Q - Proper divisors of Q
      #         - Where... (filter)
        ;q      - Product of subset
       :        - Equals...
          Q     - Q

Japt -h, 13 bytes

â à f_×¶UÃmÊn

Try it

Jelly, 9 bytes

ŒPP=³ƊƇẈṀ

Try it online!

-1 byte thanks to someone

-2 bytes thanks to ErikTheOutgolfer

Javascript (ES6), 39 bytes

f=(n,i=0)=>n%++i?n>i&&f(n,i):1+f(n/i,i)

There's probably a few bytes that can be saved here and there. Just uses the greedy algorithm for the factors.

Perl 6, 38 bytes

{$!=$_;+grep {$!%%$_&&($!/=$_)},1..$_}

Try it online!

Takes the greedy approach to selecting divisors.