Skip to content

aliquotSum

Subhajit Sahu edited this page Aug 9, 2022 · 3 revisions

Sum all proper divisors of a number.

Similar: properDivisors, aliquotSum.


function aliquotSum(x)
// x: a number

const xnumber = require('extra-number');


xnumber.aliquotSum(6);
// → 6 (1+2+3)

xnumber.aliquotSum(1);
// → 0

xnumber.aliquotSum(0);
// → 0

xnumber.aliquotSum(-24);
// → 36 (1+2+3+4+6+8+12)


References

Clone this wiki locally