numlib::sumdivisors -- sum
of divisors of an integer
Introductionnumlib::sumdivisors(n) returns the sum of
the positive divisors of the integer n.
Call(s)numlib::sumdivisors(n)
Parametersn |
- | an integer |
Returnsnumlib::sumdivisors(n) returns a
nonnegative integer.
Related
Functionsnumlib::sigma,
numlib::divisors,
numlib::numdivisors
Detailsnumlib::sumdivisors(0) returns
0.numlib::sumdivisors returns the function call with
evaluated argument if the argument is not a number.numlib::sumdivisors returns an error if the argument
evaluates to a number of wrong type.numlib::sumdivisors(n) is the same as
numlib::sigma(n,1).
Example
1The sum of the positive divisors of 120 is 360:
>> numlib::sumdivisors(120)
360
Example
2The sum of the positive divisors of -63 is 104:
>> numlib::sumdivisors(-63)
104
Backgroundifactor is used for factoring
n.