galois.divisor_sigma

galois.divisor_sigma(n, k=1)

Returns the sum of \(k\)-th powers of the positive divisors of \(n\).

Parameters
  • n (int) – Any integer.

  • k (int, optional) – The degree of the positive divisors. The default is 1 which corresponds to \(\sigma_1(n)\) which is the sum of positive divisors.

Returns

The sum of divisors function \(\sigma_k(n)\).

Return type

int

Notes

This function implements the \(\sigma_k(n)\) function. It is defined as:

\[\sigma_k(n) = \sum_{d\ |\ n} d^k\]

Examples

In [1]: galois.divisors(9)
Out[1]: [1, 3, 9]

In [2]: galois.divisor_sigma(9, k=0)
Out[2]: 3

In [3]: galois.divisor_sigma(9, k=1)
Out[3]: 13

In [4]: galois.divisor_sigma(9, k=2)
Out[4]: 91