# Divisor function

In mathematics, and specifically in number theory, a divisor function is an arithmetic function related to the divisors of an integer. When referred to as the divisor function, it counts the number of divisors of an integer (including 1 and the number itself). It appears in a number of remarkable identities, including relationships on the Riemann zeta function and the Eisenstein series of modular forms. Divisor functions were studied by Ramanujan, who gave a number of important congruences and identities; these are treated separately in the article Ramanujan's sum.

A related function is the divisor summatory function, which, as the name implies, is a sum over the divisor function.

## Definition

The sum of positive divisors function σx(n), for a real or complex number x, is defined as the sum of the xth powers of the positive divisors of n. It can be expressed in sigma notation as

$\sigma _{x}(n)=\sum _{d\mid n}d^{x}\,\!,$ where ${d\mid n}$ is shorthand for "d divides n". The notations d(n), ν(n) and τ(n) (for the German Teiler = divisors) are also used to denote σ0(n), or the number-of-divisors function (). When x is 1, the function is called the sigma function or sum-of-divisors function, and the subscript is often omitted, so σ(n) is the same as σ1(n) ().

The aliquot sum s(n) of n is the sum of the proper divisors (that is, the divisors excluding n itself, ), and equals σ1(n)  n; the aliquot sequence of n is formed by repeatedly applying the aliquot sum function.

## Example

For example, σ0(12) is the number of the divisors of 12:

{\begin{aligned}\sigma _{0}(12)&=1^{0}+2^{0}+3^{0}+4^{0}+6^{0}+12^{0}\\&=1+1+1+1+1+1=6,\end{aligned}} while σ1(12) is the sum of all the divisors:

{\begin{aligned}\sigma _{1}(12)&=1^{1}+2^{1}+3^{1}+4^{1}+6^{1}+12^{1}\\&=1+2+3+4+6+12=28,\end{aligned}} and the aliquot sum s(12) of proper divisors is:

{\begin{aligned}s(12)&=1^{1}+2^{1}+3^{1}+4^{1}+6^{1}\\&=1+2+3+4+6=16.\end{aligned}} ## Table of values

The cases x = 2 to 5 are listed in , x = 6 to 24 are listed in .

nfactorizationσ0(n)σ1(n)σ2(n)σ3(n)σ4(n)
1111111
22235917
3324102882
422372173273
552626126626
623412502521394
7728503442402
823415855854369
932313917576643
1025418130113410642
1111212122133214642
12223628210204422386
1313214170219828562
1427424250309640834
1535424260352851332
1624531341468169905
1717218290491483522
182326394556813112931
19192203626860130322
202256425469198170898
21374325009632196964
2221143661011988248914
232322453012168279842
2423386085016380358258
255233165115751391251
2621344285019782485554
273344082020440538084
28227656105025112655746
292923084224390707282
30235872130031752872644
313123296229792923522
32256631365374491118481
333114481220372961200644
342174541450442261419874
35574481300433441503652
3622329911911552611813539
37372381370506541874162
382194601810617402215474
393134561700615442342084
402358902210737102734994
41412421682689222825762
422378962500866883348388
43432441850795083418802
4422116842562972363997266
453256782366953824158518
4622347226501095124757314
474724822101038244879682
482431012434101310685732210
497235724511179935767203
5025269332551417596651267

## Properties

### Formulas at prime powers

For a prime number p,

{\begin{aligned}\sigma _{0}(p)&=2\\\sigma _{0}(p^{n})&=n+1\\\sigma _{1}(p)&=p+1\end{aligned}} because by definition, the factors of a prime number are 1 and itself. Also, where pn# denotes the primorial,

$\sigma _{0}(p_{n}\#)=2^{n}$ since n prime factors allow a sequence of binary selection ($p_{i}$ or 1) from n terms for each proper divisor formed.

Clearly, $1<\sigma _{0}(n) and σ(n) > n for all n > 2.

The divisor function is multiplicative, but not completely multiplicative:

$\gcd(a,b)=1\Longrightarrow \sigma _{x}(ab)=\sigma _{x}(a)\sigma _{x}(b).$ The consequence of this is that, if we write

$n=\prod _{i=1}^{r}p_{i}^{a_{i}}$ where r = ω(n) is the number of distinct prime factors of n, pi is the ith prime factor, and ai is the maximum power of pi by which n is divisible, then we have: 

$\sigma _{x}(n)=\prod _{i=1}^{r}\sum _{j=0}^{a_{i}}p_{i}^{jx}=\prod _{i=1}^{r}\left(1+p_{i}^{x}+p_{i}^{2x}+\cdots +p_{i}^{a_{i}x}\right).$ which is equivalent to the useful formula: 

$\sigma _{x}(n)=\prod _{i=1}^{r}{\frac {p_{i}^{(a_{i}+1)x}-1}{p_{i}^{x}-1}}.$ It follows (by setting x = 0) that d(n) is: 

$\sigma _{0}(n)=\prod _{i=1}^{r}(a_{i}+1).$ For example, if n is 24, there are two prime factors (p1 is 2; p2 is 3); noting that 24 is the product of 23×31, a1 is 3 and a2 is 1. Thus we can calculate $\sigma _{0}(24)$ as so:

$\sigma _{0}(24)=\prod _{i=1}^{2}(a_{i}+1)=(3+1)(1+1)=4\cdot 2=8.$ The eight divisors counted by this formula are 1, 2, 4, 8, 3, 6, 12, and 24.

### Other properties and identities

Euler proved the remarkable recurrence:

{\begin{aligned}\sigma (n)&=\sigma (n-1)+\sigma (n-2)-\sigma (n-5)-\sigma (n-7)+\sigma (n-12)+\sigma (n-15)+\cdots \\&=\sum _{i\in \mathbb {Z} }(-1)^{i+1}\left(\sigma \left(n-{\frac {1}{2}}\left(3i^{2}-i\right)\right)+\delta \left(n,{\frac {1}{2}}\left(3i^{2}-i\right)\right)n\right)\end{aligned}} where we set $\sigma (0)=n$ if it occurs and $\sigma (i)=0$ for $i\leq 0,$ , we use the Kronecker delta $\delta (\cdot ,\cdot ),$ and ${\tfrac {1}{2}}\left(3i^{2}-i\right)$ are the pentagonal numbers. Indeed, Euler proved this by logarithmic differentiation of the identity in his Pentagonal number theorem.

For a non-square integer, n, every divisor, d, of n is paired with divisor n/d of n and $\sigma _{0}(n)$ is even; for a square integer, one divisor (namely ${\sqrt {n}}$ ) is not paired with a distinct divisor and $\sigma _{0}(n)$ is odd. Similarly, the number $\sigma _{1}(n)$ is odd if and only if n is a square or twice a square.

We also note s(n) = σ(n)  n. Here s(n) denotes the sum of the proper divisors of n, that is, the divisors of n excluding n itself. This function is the one used to recognize perfect numbers which are the n for which s(n) = n. If s(n) > n then n is an abundant number and if s(n) < n then n is a deficient number.

If n is a power of 2, for example, $n=2^{k}$ , then $\sigma (n)=2\cdot 2^{k}-1=2n-1,$ and s(n) = n - 1, which makes n almost-perfect.

As an example, for two distinct primes p and q with p < q, let

$n=pq.$ Then

$\sigma (n)=(p+1)(q+1)=n+1+(p+q),$ $\varphi (n)=(p-1)(q-1)=n+1-(p+q),$ and

$n+1=(\sigma (n)+\varphi (n))/2,$ $p+q=(\sigma (n)-\varphi (n))/2,$ where $\varphi (n)$ is Euler's totient function.

Then, the roots of:

$(x-p)(x-q)=x^{2}-(p+q)x+n=x^{2}-[(\sigma (n)-\varphi (n))/2]x+[(\sigma (n)+\varphi (n))/2-1]=0$ allow us to express p and q in terms of σ(n) and φ(n) only, without even knowing n or p+q, as:

$p=(\sigma (n)-\varphi (n))/4-{\sqrt {[(\sigma (n)-\varphi (n))/4]^{2}-[(\sigma (n)+\varphi (n))/2-1]}},$ $q=(\sigma (n)-\varphi (n))/4+{\sqrt {[(\sigma (n)-\varphi (n))/4]^{2}-[(\sigma (n)+\varphi (n))/2-1]}}.$ Also, knowing n and either $\sigma (n)$ or $\varphi (n)$ (or knowing p+q and either $\sigma (n)$ or $\varphi (n)$ ) allows us to easily find p and q.

In 1984, Roger Heath-Brown proved that the equality

$\sigma _{0}(n)=\sigma _{0}(n+1)$ is true for an infinity of values of n, see .

## Series relations

Two Dirichlet series involving the divisor function are: 

$\sum _{n=1}^{\infty }{\frac {\sigma _{a}(n)}{n^{s}}}=\zeta (s)\zeta (s-a)\quad {\text{for}}\quad s>1,s>a+1,$ which for d(n) = σ0(n) gives: 

$\sum _{n=1}^{\infty }{\frac {d(n)}{n^{s}}}=\zeta ^{2}(s)\quad {\text{for}}\quad s>1,$ and 

$\sum _{n=1}^{\infty }{\frac {\sigma _{a}(n)\sigma _{b}(n)}{n^{s}}}={\frac {\zeta (s)\zeta (s-a)\zeta (s-b)\zeta (s-a-b)}{\zeta (2s-a-b)}}.$ A Lambert series involving the divisor function is: 

$\sum _{n=1}^{\infty }q^{n}\sigma _{a}(n)=\sum _{n=1}^{\infty }\sum _{j=1}^{\infty }n^{a}q^{j\,n}=\sum _{n=1}^{\infty }{\frac {n^{a}q^{n}}{1-q^{n}}}$ for arbitrary complex |q|  1 and a. This summation also appears as the Fourier series of the Eisenstein series and the invariants of the Weierstrass elliptic functions.

For $k>0$ exists an explicit series representation with Ramanujan sums $c_{m}(n)$ as :

$\sigma _{k}(n)=\zeta (k+1)n^{k}\sum _{m=1}^{\infty }{\frac {c_{m}(n)}{m^{k+1}}}.$ The computation of the first terms of $c_{m}(n)$ shows its oscillations around the "average value" $\zeta (k+1)n^{k}$ :

$\sigma _{k}(n)=\zeta (k+1)n^{k}\left[1+{\frac {(-1)^{n}}{2^{k+1}}}+{\frac {2\cos {\frac {2\pi n}{3}}}{3^{k+1}}}+{\frac {2\cos {\frac {\pi n}{2}}}{4^{k+1}}}+\cdots \right]$ ## Growth rate

In little-o notation, the divisor function satisfies the inequality:

${\mbox{for all }}\varepsilon >0,\quad d(n)=o(n^{\varepsilon }).$ More precisely, Severin Wigert showed that:

$\limsup _{n\to \infty }{\frac {\log d(n)}{\log n/\log \log n}}=\log 2.$ On the other hand, since there are infinitely many prime numbers,

$\liminf _{n\to \infty }d(n)=2.$ In Big-O notation, Peter Gustav Lejeune Dirichlet showed that the average order of the divisor function satisfies the following inequality:

${\mbox{for all }}x\geq 1,\sum _{n\leq x}d(n)=x\log x+(2\gamma -1)x+O({\sqrt {x}}),$ where $\gamma$ is Euler's gamma constant. Improving the bound $O({\sqrt {x}})$ in this formula is known as Dirichlet's divisor problem.

The behaviour of the sigma function is irregular. The asymptotic growth rate of the sigma function can be expressed by: 

$\limsup _{n\rightarrow \infty }{\frac {\sigma (n)}{n\,\log \log n}}=e^{\gamma },$ where lim sup is the limit superior. This result is Grönwall's theorem, published in 1913 (Grönwall 1913). His proof uses Mertens' 3rd theorem, which says that:

$\lim _{n\to \infty }{\frac {1}{\log n}}\prod _{p\leq n}{\frac {p}{p-1}}=e^{\gamma },$ where p denotes a prime.

In 1915, Ramanujan proved that under the assumption of the Riemann hypothesis, the inequality:

$\ \sigma (n) (Robin's inequality)

holds for all sufficiently large n (Ramanujan 1997). The largest known value that violates the inequality is n=5040. In 1984, Guy Robin proved that the inequality is true for all n > 5040 if and only if the Riemann hypothesis is true (Robin 1984). This is Robin's theorem and the inequality became known after him. Robin furthermore showed that if the Riemann hypothesis is false then there are an infinite number of values of n that violate the inequality, and it is known that the smallest such n > 5040 must be superabundant (Akbary & Friggstad 2009). It has been shown that the inequality holds for large odd and square-free integers, and that the Riemann hypothesis is equivalent to the inequality just for n divisible by the fifth power of a prime (Choie et al. 2007).

Robin also proved, unconditionally, that the inequality:

$\ \sigma (n) holds for all n ≥ 3.

A related bound was given by Jeffrey Lagarias in 2002, who proved that the Riemann hypothesis is equivalent to the statement that:

$\sigma (n) for every natural number n > 1, where $H_{n}$ is the nth harmonic number, (Lagarias 2002).