Skip to main content
Shaved off two more bytes
Source Link
user83717
user83717

Javascript (ES6), 4139 bytes

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

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

Javascript (ES6), 41 bytes

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

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

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.

deleted 1 character in body
Source Link
user83717
user83717

Javascript (ES6), 4241 bytes

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

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

Javascript (ES6), 42 bytes

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

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

Javascript (ES6), 41 bytes

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

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

Source Link
user83717
user83717

Javascript (ES6), 42 bytes

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

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