Sum of Divisors - Maple Help

NumberTheory

 SumOfDivisors
 sum of powers of the divisors

Calling Sequence

 SumOfDivisors(n) SumOfDivisors(n, k) sigma(n) $\mathrm{\sigma }\left(n\right)$ sigma[k](n) ${\mathrm{\sigma }}_{k}\left(n\right)$ tau(n) $\mathrm{\tau }\left(n\right)$

Parameters

 n - integer k - (optional) non-negative integer; defaults to $1$

Description

 • The SumOfDivisors(n) command computes the sum of the positive divisors of n.
 • If n has divisors ${d}_{i}$ for $i$ from $1$ to $r$, then SumOfDivisors(n, k) computes the sum of the powers of the positive divisors and is equal to $\sum _{i=1}^{r}{d}_{i}^{k}$.
 • sigma ($\mathrm{\sigma }$) is an alternate calling sequence for SumOfDivisors, where sigma[k](n) is equal to SumOfDivisors(n, k) and k defaults to $1$ if the index is omitted.
 • tau ($\mathrm{\tau }$) counts the number of divisors of n. That is, tau(n) is equal to SumOfDivisors(n, 0).
 • Every prime number divides 0 evenly, so 0 has infinitely many prime factors. For consistency with, for example, the Divisors command, SumOfDivisors(0) returns an error, as does SumOfDivisors(0, k) for any k.
 • You can enter the commands sigma and tau using either the 1-D or 2-D calling sequence. For example, sigma(8) is equivalent to $\mathrm{\sigma }\left(8\right)$, sigma[2](8) is equivalent to ${\mathrm{\sigma }}_{2}\left(8\right)$, and tau(8) is equivalent to $\mathrm{\tau }\left(8\right)$.
 • If $\prod _{i=1}^{m}{p}_{i}^{{a}_{i}}$ is the prime factorization of the n, then SumOfDivisors is given by the formula $\prod _{i=1}^{m}\frac{{p}_{i}^{\left({a}_{i}+1\right)k}-1}{{p}_{i}^{k}-1}$ if k is nonzero and by the formula $\prod _{i=1}^{m}\left({a}_{i}+1\right)$ if k is zero.

Examples

 > $\mathrm{with}\left(\mathrm{NumberTheory}\right):$
 > $\mathrm{Divisors}\left(12\right)$
 $\left\{{1}{,}{2}{,}{3}{,}{4}{,}{6}{,}{12}\right\}$ (1)
 > $\mathrm{SumOfDivisors}\left(12\right)$
 ${28}$ (2)
 > $\mathrm{\tau }\left(12\right)$
 ${6}$ (3)
 > $\mathrm{Divisors}\left(52\right)$
 $\left\{{1}{,}{2}{,}{4}{,}{13}{,}{26}{,}{52}\right\}$ (4)
 > $\mathrm{\sigma }\left[2\right]\left(52\right)$
 ${3570}$ (5)
 > $\mathrm{SumOfDivisors}\left(52,2\right)$
 ${3570}$ (6)
 > $\mathrm{SumOfDivisors}\left(0\right)$
 > $\mathrm{\tau }\left(0\right)$

Compatibility

 • The NumberTheory[SumOfDivisors] command was introduced in Maple 2016.