Perfect numbers: Difference between revisions
Content added Content deleted
Line 986: | Line 986: | ||
return chain( |
return chain( |
||
rng(nFrom, nTo), |
rng(nFrom, nTo), |
||
function ( |
function mPerfect(n) { |
||
return ( |
return (chain( |
||
rng(1, Math.floor(Math.sqrt(n))), |
|||
function (y) { |
|||
⚫ | |||
rng(1, Math.floor(Math.sqrt(n))), |
|||
⚫ | |||
function (y) { |
|||
⚫ | |||
} |
|||
).reduce(function (a, x) { |
|||
⚫ | |||
}, 0) / 2 === n; |
|||
} |
} |
||
)( |
).reduce(function (a, x) { |
||
⚫ | |||
⚫ | |||
} |
} |
||
); |
); |
||