numlib::sigma -- sum of divisors
of an integer
Introductionnumlib::sigma(n) returns the sum of the
positive divisors of n.
numlib::sigma(n, k) returns the sum of the
k-th powers of the positive divisors of
n.
Call(s)numlib::sigma(n)
numlib::sigma(n, k)
Parametersn |
- | an integer |
k |
- | a nonnegative integer |
Returnsnumlib::sigma returns an integer.
Related
Functionsnumlib::divisors,
numlib::numdivisors
Detailsnumlib::sigma(0) returns
0.numlib::sigma returns the function call with evaluated
argument if at least one argument is not a number.numlib::sigma returns an error if one of its arguments
evaluates to a number of wrong type.numlib::sigma(n,0) is the same as
numlib::numdivisors(n)
and numlib::tau(n).numlib::sigma(n,1) is the same function
as numlib::sumdivisors(n)
and numlib::sigma(n).
Example
1The sum of the positive divisors of is 360:
>> numlib::sigma(120)
360
Example
2The sum of the fifth powers of the positive divisors of is 25799815800:
>> numlib::sigma(120,5)
25799815800
Backgroundifactor is used for factoring
n.