Skip to content

aliquotSum

Subhajit Sahu edited this page Aug 9, 2022 · 1 revision

Sum all proper divisors of a bigint.

Similar: properDivisors, aliquotSum.


function aliquotSum(x)
// x: a bigint

const xbigint = require('extra-bigint');


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

xbigint.aliquotSum(1n);
// → 0n

xbigint.aliquotSum(0n);
// → 0n

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


References

Clone this wiki locally