-
Notifications
You must be signed in to change notification settings - Fork 0
aliquotSum
Subhajit Sahu edited this page Aug 8, 2022
·
1 revision
Sum all proper divisors of a number.
Similar: properDivisors, aliquotSum, isPrime.
function aliquotSum(x)
// x: a number
const xmath = require('extra-math');
xmath.aliquotSum(6);
// → 6 (1+2+3)
xmath.aliquotSum(1);
// → 0
xmath.aliquotSum(0);
// → 0
xmath.aliquotSum(-24);
// → 36 (1+2+3+4+6+8+12)