Skip to main content
1 of 4
Arnauld
  • 197.8k
  • 20
  • 180
  • 650

##Javascript (ES6), 53 bytes

n=>{for(i=2,r=0;i<n;n%i?i++:r+=!((n/=i)%i));return r}

Example:

let e =
n=>{for(i=2,r=0;i<n;n%i?i++:r+=!((n/=i)%i));return r}

// computing e(n) for n in [1, 30]
for(var n = 1, list = []; n <= 30; n++) {
  list.push(e(n));
}
console.log(list.join(','));

Arnauld
  • 197.8k
  • 20
  • 180
  • 650