## `numlib::sigma` -- sum of divisors of an integer

#### Introduction

`numlib::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)`

#### Parameters

`n` | - | an integer
`k` | - | a nonnegative integer

#### Returns

`numlib::sigma` returns an integer.

#### Related Functions

`numlib::divisors`, `numlib::numdivisors`

#### Details

- `numlib::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 1

The sum of the positive divisors of is 360:

    >> numlib::sigma(120)

                                        360

#### Example 2

The sum of the fifth powers of the positive divisors of is 25799815800:

    >> numlib::sigma(120,5)

                                    25799815800

#### Background

- Internally, `ifactor` is used for factoring `n`.

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000