# divisor_sum function

Sum of the positive divisors of a whole number.

## How to write it

### divisor_sum(n)

**n**

A whole number. Takes a whole number.

## Examples

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

  `divisor_sum(12)`

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

  [Open in the solver](https://hilberon.com/?q=divisor_sum%2812%29)

## Related functions

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

  Sum of the powers of the 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.
- [euler_e](https://hilberon.com/library/euler_e)

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

  Euler's totient: how many whole numbers up to n are coprime to n.
- [discrete_log](https://hilberon.com/library/discrete_log)

  The exponent that takes a base to a value modulo a number.

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