Number of divisors function

In number theory the number of divisors function of a positive integer, denoted d(n) or τ(n), is the number of positive integer divisors of the number n.

It is a multiplicative function, that is is m and n are coprime then $$d(mn) = d(m) d(n)$$.

The value of d on a general integer n with prime factorisation


 * $$n = \prod_i p_i^{a_i} \,$$

is then


 * $$d(n) = \prod_i \left(a_i+1\right) .\,$$

The average order of d(n) is $$\log(n)$$.