MathorynMathematical Formula Database

Number Theory

Number of Divisors

Once a number is written as a product of prime powers, the number of its positive divisors is the product of the exponents each increased by one. Use it to count factors of a number quickly, for example when arranging items into equal rows.

d(n)=∏i=1k(ei+1),n=p1e1p2e2⋯pkekd(n)=\prod_{i=1}^{k}(e_i+1),\qquad n=p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}
LaTeXd(n)=\prod_{i=1}^{k}(e_i+1),\qquad n=p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}

Variables

pip_i
distinct primes
eie_i
their exponents
d(n)d(n)
number of positive divisors

Example

How many divisors does 360360 have?

  1. 360=23⋅32⋅5360=2^3\cdot3^2\cdot5.
  2. (3+1)(2+1)(1+1)(3+1)(2+1)(1+1).

Answer: 2424.

Related formulas