# Sum of divisors function (divisor_sigma)

Sum of the powers of the divisors of a whole number.

## How to write it

### divisor_sigma(n)

The sum of the divisors.

**n**

A whole number. Takes a whole number.

### divisor_sigma(k, n)

The sum of the k-th powers of the divisors.

**k**

The power. Takes a whole number.

**n**

A whole number. Takes a whole number.

## Examples

- $\displaystyle \operatorname{divisor\_sigma}(12) = 28$

  `divisor_sigma(12)`

  In the solver, `divisor_sigma(12)` gives `28`.

  [Open in the solver](https://hilberon.com/?q=divisor_sigma%2812%29)
- $\displaystyle \operatorname{divisor\_sigma}(2, 12) = 210$

  `divisor_sigma(2, 12)`

  In the solver, `divisor_sigma(2, 12)` gives `210`.

  [Open in the solver](https://hilberon.com/?q=divisor_sigma%282%2C%2012%29)

## Related functions

- [divisor_sum](https://hilberon.com/library/divisor_sum)

  Sum of the positive divisors of a whole number.
- [divisor_count](https://hilberon.com/library/divisor_count)

  How many positive divisors a whole number has.
- [divisors](https://hilberon.com/library/divisors)

  The positive divisors of a whole number, in increasing order.
- [discrete_log](https://hilberon.com/library/discrete_log)

  The exponent that takes a base to a value modulo a number.
- [euler_e](https://hilberon.com/library/euler_e)

  The n-th Euler number.
- [convergents](https://hilberon.com/library/convergents)

  The convergents of a continued fraction.

---
Source: https://hilberon.com/library/divisor_sigma
