import * as euler from 'euler.js' var perfect_number = function(n) { var s = euler.divisors(n).reduce((a,n)=>a+=n); return n === s; }