Skip to main content
AMC 12 focus

Divisor Functions

τ(n) counts divisors, σ(n) sums them — both computable straight from a prime factorization, no listing required.

Both divisor functions below are multiplicative: if gcd(a,b)=1\gcd(a,b)=1, thenf(ab)=f(a)f(b)f(ab)=f(a)f(b). That property is what lets you compute them prime-power by prime-power and multiply the results, rather than examining every divisor individually.

Number of divisors, τ(n)\tau(n)

For n=p1e1pkekn=p_1^{e_1}\cdots p_k^{e_k}:

τ(n)=(e1+1)(e2+1)(ek+1)\tau(n) = (e_1+1)(e_2+1)\cdots(e_k+1)

Sum of divisors, σ(n)\sigma(n)

Each prime’s contribution is a geometric series, summed over its powers from 0 to eie_i:

σ(n)=i(1+pi+pi2++piei)=ipiei+11pi1\sigma(n) = \prod_{i} \left(1+p_i+p_i^2+\cdots+p_i^{e_i}\right) = \prod_i \dfrac{p_i^{e_i+1}-1}{p_i-1}

Worked example

Problem: Find τ(360)\tau(360) and σ(360)\sigma(360), given 360=23325360=2^3\cdot3^2\cdot5.

Solution:

τ(360)=(3+1)(2+1)(1+1)=4×3×2=24\tau(360) = (3+1)(2+1)(1+1) = 4\times3\times2=24
σ(360)=(1+2+4+8)(1+3+9)(1+5)=15×13×6=1170\sigma(360) = (1+2+4+8)(1+3+9)(1+5) = 15\times13\times6 = 1170

Practice problems

1.Find τ(100)\tau(100), given 100=22×52100=2^2\times5^2.

2.Find σ(28)\sigma(28), given 28=22×728=2^2\times7, and check whether 28 is a “perfect number” (σ(n)=2n\sigma(n)=2n).

3.Find the smallest nn with exactly 6 divisors.

4.Find σ(45)\sigma(45), given 45=32×545=3^2\times5.