The Divisor and Sigma Functions

How many ways can 360 be divided evenly? What happens when you add up all its divisors? These two innocent-looking counting questions lead to two of the oldest functions in number theory. They are the divisor function d(n)d(n) and the sum-of-divisors function σk(n)\sigma_k(n). They arose historically from the study of perfect numbers. Perfect numbers equal the sum of their proper divisors. They also arose from questions about the factorization structure of integers. But their reach today extends into analytic number theory, modular forms, and cryptography. The reason these functions are tractable, rather than a chaotic mess depending unpredictably on nn, is that they are multiplicative. Knowing their values on prime powers determines their values everywhere. This is not an accident. It is a direct consequence of the definitions being built from divisor sums combined with the Fundamental Theorem of Arithmetic. Once multiplicativity is established, computing d(n)d(n) or σk(n)\sigma_k(n) for any nn reduces to two steps. First, factor nn. Then apply a simple closed formula on each prime power factor. The big picture is that dd and σk\sigma_k are the prototypical examples in the theory of Multiplicative Functions. This is the toolbox that turns a hard combinatorial question about a specific integer nn into an easy local computation. That computation happens at each prime dividing nn. This same pattern recurs throughout number theory. Define a function via a divisor sum, prove multiplicativity, then compute on prime powers. This applies to Euler's totient function, the Möbius function, and beyond. This article gives the rigorous definitions of d(n)d(n) and σk(n)\sigma_k(n). It proves from first principles that both are multiplicative. It derives the explicit prime-power and general formulas. It also works through fully computed examples. It closes by connecting these functions to the analytic machinery that turns them into powerful tools. This machinery includes Dirichlet series and average orders. Together they help study the distribution of integers.

Key takeaways
  • d(n)d(n) counts the positive divisors of nn; σk(n)\sigma_k(n) sums the kk-th powers of the positive divisors of nn.
  • Both are defined via sums over divisors, so their behavior is governed entirely by the prime factorization of nn.
  • Multiplicativity means f(mn)=f(m)f(n)f(mn) = f(m)f(n) whenever gcd⁡(m,n)=1\gcd(m,n)=1; both dd and σk\sigma_k have this property.
  • On a prime power pap^a, the formulas are explicit: d(pa)=a+1d(p^a) = a+1 and σk(pa)=pk(a+1)−1pk−1\sigma_k(p^a) = \dfrac{p^{k(a+1)}-1}{p^k - 1} (with σ0=d\sigma_0 = d).
  • These functions feed directly into perfect number theory (σ1\sigma_1), Dirichlet series (ζ(s)2\zeta(s)^2, ζ(s)ζ(s−k)\zeta(s)\zeta(s-k)), and average-order estimates.
  • Key idea: a divisor sum factors along the Fundamental Theorem of Arithmetic, so multiplicative functions reduce global questions to local, prime-by-prime computations.

Where this lives today

The divisor and sigma functions are not museum pieces; they are working tools across mathematics and its applications. In analytic number theory, d(n)d(n) and σk(n)\sigma_k(n) are the model examples for the average order problem: one studies ∑n≤xd(n)\sum_{n\le x} d(n) via Dirichlet's hyperbola method to get xlog⁡x+(2γ−1)x+O(x)x\log x + (2\gamma-1)x + O(\sqrt x), and ∑n≤xσ(n)∼π212x2\sum_{n \le x}\sigma(n) \sim \frac{\pi^2}{12}x^2, both foreshadowing the general machinery of Average Order of Arithmetic Functions. Their multiplicativity is precisely what makes the associated Dirichlet series factor into Euler products: ∑nd(n)n−s=ζ(s)2\sum_n d(n)n^{-s} = \zeta(s)^2 and ∑nσk(n)n−s=ζ(s)ζ(s−k)\sum_n \sigma_k(n) n^{-s} = \zeta(s)\zeta(s-k), connecting directly to Dirichlet Series and Euler Products and to the analytic continuation properties of the Riemann zeta function. In the theory of perfect and amicable numbers, σ\sigma is the defining object: nn is perfect iff σ(n)=2n\sigma(n) = 2n, and the search for odd perfect numbers (still open) is a search for solutions to this equation with no known even-style structural theorem. In cryptography, the Euler totient function φ(n)\varphi(n) (a close cousin, also multiplicative and built from prime-power formulas) underlies RSA key generation, and the same prime-factorization-driven multiplicative-function toolkit used here for d,σkd,\sigma_k is the template for computing φ(n)\varphi(n) efficiently once nn's factorization is known. In combinatorics and algebra, d(n)d(n) counts the number of subgroups of a cyclic group of order nn, and σ1(n)\sigma_1(n) appears in the theory of modular forms as (up to normalization) the Fourier coefficients of Eisenstein series of weight k+1k+1, linking elementary divisor sums to the deep machinery of modular forms and LL-functions.

Ask the tutor: How does Dirichlet's hyperbola method use the divisor function's multiplicativity to derive its average order ∑n≤xd(n)∼xlog⁡x\sum_{n \le x} d(n) \sim x\log x?

DefinitionThe divisor function and the sigma function

Let nn be a positive integer. The divisor function d(n)d(n) (also written τ(n)\tau(n)) is the number of positive divisors of nn:

d(n)=∑e∣n1=#{ e∈Z>0:e∣n }.d(n) = \sum_{e \mid n} 1 = \#\{\, e \in \mathbb{Z}_{>0} : e \mid n \,\}.

For a real or complex number kk, the sigma function σk(n)\sigma_k(n) is the sum of the kk-th powers of the positive divisors of nn:

σk(n)=∑e∣nek.\sigma_k(n) = \sum_{e \mid n} e^k.

Two special cases recur constantly:

  • σ0(n)=d(n)\sigma_0(n) = d(n), the divisor-counting function.
  • σ1(n)=σ(n)\sigma_1(n) = \sigma(n), the ordinary sum-of-divisors function, simply written σ(n)\sigma(n).

A positive integer nn is called perfect if σ(n)=2n\sigma(n) = 2n, equivalently if nn equals the sum of its proper (i.e. smaller-than-nn) divisors. An arithmetic function f:Z>0→Cf : \mathbb{Z}_{>0} \to \mathbb{C} is multiplicative if f(1)=1f(1) = 1 and f(mn)=f(m)f(n)f(mn) = f(m) f(n) for all coprime positive integers m,nm, n (i.e. gcd⁡(m,n)=1\gcd(m,n) = 1). It is completely multiplicative if f(mn)=f(m)f(n)f(mn) = f(m)f(n) holds for all pairs m,nm,n, without the coprimality restriction. (See Multiplicative Functions.)

Intuition

Think of the divisors of nn as sitting on a grid indexed by the exponents in nn's prime factorization. If n=p1a1⋯prarn = p_1^{a_1} \cdots p_r^{a_r}, then every divisor of nn is obtained by independently choosing an exponent 0≤bi≤ai0 \le b_i \le a_i for each prime pip_i and forming p1b1⋯prbrp_1^{b_1}\cdots p_r^{b_r}. This is exactly a Cartesian product of choices, one independent choice per prime. Counting the divisors is then counting lattice points in a box {0,…,a1}×⋯×{0,…,ar}\{0,\dots,a_1\}\times\cdots\times\{0,\dots,a_r\}, whose size is the product (a1+1)(a2+1)⋯(ar+1)(a_1+1)(a_2+1)\cdots(a_r+1) — multiplicativity made visible as literal geometric independence of the prime directions. The same "independent choice per prime" picture explains why σk\sigma_k factors too: summing eke^k over all divisors ee is summing over all such lattice points, and because ek=(p1b1)k⋯(prbr)ke^k = (p_1^{b_1})^k \cdots (p_r^{b_r})^k factors along the coordinates, the sum over the box factors into a product of sums over each coordinate axis — one geometric series per prime.

Figure
Divisors of n=12=22⋅3n=12=2^2\cdot 3 as lattice points in a 3×23\times 2 box; the count d(12)=6d(12)=6 is the box's area
n = 12 = 2² · 3¹, divisors as pairs (b₁,b₂) b₂ (exp of 3) b₁ (exp of 2) 1 2 4 3 6 12 3 choices × 2 choices = 6 divisors = d(12)

Theorem statements and proofs

TheoremDivisor sums are multiplicative

Let f:Z>0→Cf: \mathbb{Z}_{>0} \to \mathbb{C} be any multiplicative function, and define

F(n)=∑e∣nf(e).F(n) = \sum_{e \mid n} f(e).

Then FF is also multiplicative.

Proof

We use the divisor-pairing technique for coprime moduli, a standard tool built directly on the definition of multiplicativity and the properties of gcd⁡\gcd. First, F(1)=∑e∣1f(e)=f(1)=1F(1) = \sum_{e \mid 1} f(e) = f(1) = 1, since ff is multiplicative and the only divisor of 11 is 11 itself. Now let m,nm,n be positive integers with gcd⁡(m,n)=1\gcd(m,n) = 1. We must show F(mn)=F(m)F(n)F(mn) = F(m)F(n).

Step 1: divisors of mnmn correspond bijectively to pairs of divisors. Define a map

Φ:{d1:d1∣m}×{d2:d2∣n}  ⟶  {e:e∣mn},Φ(d1,d2)=d1d2.\Phi : \{d_1 : d_1 \mid m\} \times \{d_2 : d_2 \mid n\} \;\longrightarrow\; \{e : e \mid mn\}, \qquad \Phi(d_1,d_2) = d_1 d_2.

We claim Φ\Phi is a bijection. Φ\Phi is well-defined: if d1∣md_1 \mid m and d2∣nd_2 \mid n, then d1d2∣mnd_1 d_2 \mid mn trivially, since m=d1m′m = d_1 m' and n=d2n′n = d_2 n' give mn=(d1d2)(m′n′)mn = (d_1d_2)(m'n'). Φ\Phi is injective: suppose d1d2=d1′d2′d_1 d_2 = d_1' d_2' with d1,d1′∣md_1, d_1' \mid m and d2,d2′∣nd_2, d_2' \mid n. Since gcd⁡(m,n)=1\gcd(m,n)=1, also gcd⁡(d1,d2′)=1\gcd(d_1, d_2') = 1 (as d1∣md_1 \mid m and d2′∣nd_2' \mid n, and any common factor of d1,d2′d_1, d_2' would be a common factor of m,nm,n). From d1d2=d1′d2′d_1 d_2 = d_1' d_2' we get d1∣d1′d2′d_1 \mid d_1' d_2'; since gcd⁡(d1,d2′)=1\gcd(d_1,d_2')=1, Euclid's lemma gives d1∣d1′d_1 \mid d_1'. By the symmetric argument d1′∣d1d_1' \mid d_1, so d1=d1′d_1 = d_1' (both positive). Then d2=d2′d_2 = d_2' follows by cancellation. Hence (d1,d2)=(d1′,d2′)(d_1,d_2) = (d_1',d_2'). Φ\Phi is surjective: let e∣mne \mid mn. Set d1=gcd⁡(e,m)d_1 = \gcd(e,m) and d2=gcd⁡(e,n)d_2 = \gcd(e,n). Clearly d1∣md_1 \mid m and d2∣nd_2 \mid n. We show e=d1d2e = d_1 d_2. Since gcd⁡(m,n)=1\gcd(m,n)=1, we have gcd⁡(d1,d2)=1\gcd(d_1,d_2) = 1 (a common divisor of d1,d2d_1,d_2 divides both mm and nn, hence divides gcd⁡(m,n)=1\gcd(m,n)=1). Also d1d2∣ed_1 d_2 \mid e: this requires a short argument. Write e=gcd⁡(e,mn)e = \gcd(e,mn) since e∣mne\mid mn. Because gcd⁡(m,n)=1\gcd(m,n) = 1, one can show gcd⁡(e,mn)=gcd⁡(e,m)gcd⁡(e,n)\gcd(e,mn) = \gcd(e,m)\gcd(e,n) — this is a standard consequence of unique factorization: for each prime pp, vp(mn)=vp(m)+vp(n)v_p(mn) = v_p(m) + v_p(n) and at most one of vp(m),vp(n)v_p(m), v_p(n) is nonzero (as gcd⁡(m,n)=1\gcd(m,n)=1), so min⁡(vp(e),vp(m)+vp(n))=min⁡(vp(e),vp(m))+min⁡(vp(e),vp(n))\min(v_p(e), v_p(m)+v_p(n)) = \min(v_p(e),v_p(m)) + \min(v_p(e),v_p(n)) once one checks both sides agree in the two cases vp(m)=0v_p(m)=0 or vp(n)=0v_p(n) = 0. Taking the product over all primes gives gcd⁡(e,mn)=gcd⁡(e,m)gcd⁡(e,n)=d1d2\gcd(e,mn) = \gcd(e,m)\gcd(e,n) = d_1 d_2. Since e∣mne \mid mn, gcd⁡(e,mn)=e\gcd(e,mn) = e, so e=d1d2e = d_1 d_2, confirming surjectivity. Thus Φ\Phi is a bijection between divisors of mnmn and pairs (d1,d2)(d_1,d_2) with d1∣md_1 \mid m, d2∣nd_2 \mid n.

Step 2: use multiplicativity of ff and coprimality of the parts. For any divisor pair from Step 1, d1∣md_1 \mid m and d2∣nd_2 \mid n with gcd⁡(m,n)=1\gcd(m,n)=1 forces gcd⁡(d1,d2)=1\gcd(d_1,d_2) = 1 (shown above). Since ff is multiplicative,

f(d1d2)=f(d1)f(d2).f(d_1 d_2) = f(d_1) f(d_2).

Step 3: factor the double sum. Using the bijection Φ\Phi to re-index the sum defining F(mn)F(mn):

F(mn)=∑e∣mnf(e)=∑d1∣m∑d2∣nf(d1d2)=∑d1∣m∑d2∣nf(d1)f(d2)=(∑d1∣mf(d1))(∑d2∣nf(d2))=F(m)F(n).F(mn) = \sum_{e \mid mn} f(e) = \sum_{d_1 \mid m} \sum_{d_2 \mid n} f(d_1 d_2) = \sum_{d_1 \mid m}\sum_{d_2\mid n} f(d_1)f(d_2) = \left(\sum_{d_1 \mid m} f(d_1)\right)\left(\sum_{d_2 \mid n} f(d_2)\right) = F(m)F(n).

The last step is legitimate distributivity of finite sums (factoring a product of sums into a double sum, and back), valid since all sums here are finite. This proves F(mn)=F(m)F(n)F(mn) = F(m)F(n) for all coprime m,nm,n, and F(1)=1F(1)=1, so FF is multiplicative. ■\blacksquare

∎
Corollaryd(n)d(n) and σk(n)\sigma_k(n) are multiplicative

The functions d(n)=σ0(n)d(n) = \sigma_0(n) and σk(n)\sigma_k(n), for any fixed kk, are multiplicative.

Proof

Apply the theorem with f(e)=1f(e) = 1 for all ee (which is trivially completely multiplicative, since 1⋅1=11\cdot 1 = 1 for all inputs, and in particular multiplicative) to get that F(n)=∑e∣n1=d(n)F(n) = \sum_{e\mid n} 1 = d(n) is multiplicative. Apply the theorem with f(e)=ekf(e) = e^k. This ff is completely multiplicative: f(ab)=(ab)k=akbk=f(a)f(b)f(ab) = (ab)^k = a^k b^k = f(a)f(b) for all a,ba,b (no coprimality needed), and f(1)=1k=1f(1) = 1^k = 1. In particular ff is multiplicative, so the theorem applies and F(n)=∑e∣nek=σk(n)F(n) = \sum_{e \mid n} e^k = \sigma_k(n) is multiplicative. ■\blacksquare

∎
TheoremPrime-power formulas

Let pp be prime and a≥0a \ge 0 an integer. Then:

d(pa)=a+1,d(p^a) = a + 1,

and for k≠0k \ne 0,

σk(pa)=1+pk+p2k+⋯+pak=pk(a+1)−1pk−1.\sigma_k(p^a) = 1 + p^k + p^{2k} + \cdots + p^{ak} = \frac{p^{k(a+1)} - 1}{p^k - 1}.

(For k=0k=0 this reduces correctly to σ0(pa)=a+1=d(pa)\sigma_0(p^a) = a+1 = d(p^a), matching the boundary formula by continuity of the geometric-sum argument, or simply by direct count.) Consequently, if n=p1a1p2a2⋯prarn = p_1^{a_1} p_2^{a_2} \cdots p_r^{a_r} is the prime factorization of n>1n > 1 (with distinct primes pip_i and ai≥1a_i \ge 1), then

d(n)=∏i=1r(ai+1),σk(n)=∏i=1rpik(ai+1)−1pik−1 (k≠0).d(n) = \prod_{i=1}^r (a_i + 1), \qquad \sigma_k(n) = \prod_{i=1}^r \frac{p_i^{k(a_i+1)} - 1}{p_i^k - 1} \ (k \ne 0).

By convention d(1)=σk(1)=1d(1) = \sigma_k(1) = 1 (empty product).

Proof

Prime power case. The positive divisors of pap^a are exactly 1,p,p2,…,pa1, p, p^2, \dots, p^a. This is because any divisor ee of pap^a must, by unique factorization, be of the form e=pbe = p^b for some 0≤b≤a0 \le b \le a: indeed if a prime q≠pq \ne p divided ee then qq would divide pap^a, contradicting unique factorization (the only prime factor of pap^a is pp); and the exponent of pp in ee cannot exceed aa since e∣pae \mid p^a. Conversely every pbp^b with 0≤b≤a0\le b\le a visibly divides pap^a. This gives exactly a+1a+1 divisors (namely b=0,1,…,ab = 0,1,\dots,a), so

d(pa)=a+1.d(p^a) = a+1.

Summing kk-th powers over these divisors,

σk(pa)=∑b=0a(pb)k=∑b=0a(pk)b,\sigma_k(p^a) = \sum_{b=0}^{a} (p^b)^k = \sum_{b=0}^a (p^k)^b,

a finite geometric series with ratio pkp^k and a+1a+1 terms. Since p≥2p \ge 2, we have pk≠1p^k \ne 1 whenever k≠0k \ne 0 (as pk=1  ⟺  k=0p^k = 1 \iff k=0 for p>1p > 1 real), so the standard finite geometric series formula applies:

σk(pa)=(pk)a+1−1pk−1=pk(a+1)−1pk−1.\sigma_k(p^a) = \frac{(p^k)^{a+1} - 1}{p^k - 1} = \frac{p^{k(a+1)}-1}{p^k-1}.

General nn. Write n=p1a1⋯prarn = p_1^{a_1}\cdots p_r^{a_r} with the pip_i distinct primes; this factorization exists and is unique by the Fundamental Theorem of Arithmetic. We prove the product formula by induction on rr. Base case r=1r=1: n=p1a1n = p_1^{a_1}, and the prime-power formulas above give exactly d(n)=a1+1d(n) = a_1+1 and σk(n)=p1k(a1+1)−1p1k−1\sigma_k(n) = \frac{p_1^{k(a_1+1)}-1}{p_1^k-1}, matching the claimed product of one factor. Inductive step: suppose the formula holds for integers with r−1r-1 distinct prime factors (r≥2r \ge 2). Let n=p1a1⋯prar=m⋅prarn = p_1^{a_1}\cdots p_r^{a_r} = m \cdot p_r^{a_r} where m=p1a1⋯pr−1ar−1m = p_1^{a_1}\cdots p_{r-1}^{a_{r-1}}. Since the pip_i are distinct primes, gcd⁡(m,prar)=1\gcd(m, p_r^{a_r}) = 1 (no prime divides both, again by unique factorization). By the Corollary above (multiplicativity of dd and σk\sigma_k),

d(n)=d(m) d(prar),σk(n)=σk(m) σk(prar).d(n) = d(m)\,d(p_r^{a_r}), \qquad \sigma_k(n) = \sigma_k(m)\,\sigma_k(p_r^{a_r}).

By the induction hypothesis applied to mm (which has exactly r−1r-1 distinct prime factors p1,…,pr−1p_1,\dots,p_{r-1}),

d(m)=∏i=1r−1(ai+1),σk(m)=∏i=1r−1pik(ai+1)−1pik−1.d(m) = \prod_{i=1}^{r-1}(a_i+1), \qquad \sigma_k(m) = \prod_{i=1}^{r-1}\frac{p_i^{k(a_i+1)}-1}{p_i^k - 1}.

Multiplying by the prime-power formula for prarp_r^{a_r} gives exactly

d(n)=∏i=1r(ai+1),σk(n)=∏i=1rpik(ai+1)−1pik−1,d(n) = \prod_{i=1}^r (a_i+1), \qquad \sigma_k(n) = \prod_{i=1}^r \frac{p_i^{k(a_i+1)}-1}{p_i^k-1},

completing the induction. ■\blacksquare

∎

Worked examples

Example 1: n=360n = 360. Factor 360=23⋅32⋅51360 = 2^3 \cdot 3^2 \cdot 5^1. Check: 8⋅9⋅5=3608 \cdot 9 \cdot 5 = 360. ✓. Divisor count. By the theorem,

d(360)=(3+1)(2+1)(1+1)=4⋅3⋅2=24.d(360) = (3+1)(2+1)(1+1) = 4 \cdot 3 \cdot 2 = 24.

Direct sanity check: the 24 divisors of 360 are 1,2,3,4,5,6,8,9,10,12,15,18,20,24,30,36,40,45,60,72,90,120,180,3601,2,3,4,5,6,8,9,10,12,15,18,20,24,30,36,40,45,60,72,90,120,180,360 — indeed 24 numbers. Sum of divisors σ1(360)\sigma_1(360). Using the geometric-series formula on each prime power:

σ1(23)=24−12−1=15,σ1(32)=33−13−1=262=13,σ1(51)=52−15−1=244=6.\sigma_1(2^3) = \frac{2^4-1}{2-1} = 15, \qquad \sigma_1(3^2) = \frac{3^3-1}{3-1} = \frac{26}{2}=13, \qquad \sigma_1(5^1) = \frac{5^2-1}{5-1} = \frac{24}{4} = 6.

So

σ(360)=15⋅13⋅6=1170.\sigma(360) = 15 \cdot 13 \cdot 6 = 1170.

Since 2n=720≠11702n = 720 \ne 1170, 360 is not perfect, but it is abundant (σ(n)>2n\sigma(n) > 2n), since 1170>7201170 > 720. Sum of squares of divisors σ2(360)\sigma_2(360). Now k=2k=2:

σ2(23)=22⋅4−122−1=256−13=2553=85,\sigma_2(2^3) = \frac{2^{2\cdot4}-1}{2^2-1} = \frac{256-1}{3} = \frac{255}{3} = 85,
σ2(32)=32⋅3−132−1=729−18=7288=91,\sigma_2(3^2) = \frac{3^{2\cdot 3}-1}{3^2-1} = \frac{729-1}{8} = \frac{728}{8} = 91,
σ2(51)=52⋅2−152−1=625−124=62424=26.\sigma_2(5^1) = \frac{5^{2\cdot 2}-1}{5^2-1} = \frac{625-1}{24} = \frac{624}{24}=26.

So

σ2(360)=85⋅91⋅26=85⋅2366=201,110.\sigma_2(360) = 85 \cdot 91 \cdot 26 = 85\cdot 2366 = 201{,}110.

(Computed as 91×26=236691\times 26 = 2366, then 85×2366=201,11085\times 2366 = 201{,}110.)

Example 2: verifying multiplicativity directly on coprime m=8m=8, n=45n=45 (so mn=360mn=360 again, but now checked without the prime-power shortcut, confirming the factoring theorem itself). Take m=8=23m = 8 = 2^3 and n=45=32⋅5n = 45 = 3^2\cdot 5, which are coprime since gcd⁡(8,45)=1\gcd(8,45)=1 (8 is a power of 2, 45 has no factor of 2). Divisors of 88: 1,2,4,81,2,4,8, so d(8)=4d(8)=4 and σ(8)=1+2+4+8=15\sigma(8) = 1+2+4+8=15. Divisors of 4545: 1,3,5,9,15,451,3,5,9,15,45, so d(45)=6d(45) = 6 and σ(45)=1+3+5+9+15+45=78\sigma(45) = 1+3+5+9+15+45 = 78. The theorem predicts

d(360)=d(8) d(45)=4⋅6=24,σ(360)=σ(8) σ(45)=15⋅78=1170,d(360) = d(8)\,d(45) = 4\cdot 6 = 24, \qquad \sigma(360) = \sigma(8)\,\sigma(45) = 15\cdot 78 = 1170,

which match Example 1's values (2424 and 11701170) exactly. This double-checks both the multiplicativity theorem and the prime-power computation against an independent route through a different coprime factorization of the same nn, confirming the whole machine is self-consistent.

CounterexampleMultiplicativity fails without the coprimality hypothesis

The theorem requires gcd⁡(m,n)=1\gcd(m,n)=1. Drop this hypothesis and multiplicativity of dd genuinely fails — dd is not completely multiplicative. Take m=n=2m = n = 2 (so gcd⁡(m,n)=2≠1\gcd(m,n) = 2 \ne 1). Then

d(m) d(n)=d(2) d(2)=2⋅2=4,d(m)\,d(n) = d(2)\,d(2) = 2 \cdot 2 = 4,

but

d(mn)=d(4)=d(22)=2+1=3.d(mn) = d(4) = d(2^2) = 2+1 = 3.

Since 4≠34 \ne 3, the identity d(mn)=d(m)d(n)d(mn) = d(m)d(n) fails when m,nm,n share a common factor. The reason traces directly to the proof: the bijection Φ(d1,d2)=d1d2\Phi(d_1,d_2) = d_1 d_2 between pairs of divisors of m,nm,n and divisors of mnmn is no longer injective once gcd⁡(m,n)>1\gcd(m,n) > 1. For m=n=2m=n=2: divisors of mm are {1,2}\{1,2\}, divisors of nn are {1,2}\{1,2\}, giving four pairs (1,1),(1,2),(2,1),(2,2)(1,1),(1,2),(2,1),(2,2), but their products are 1,2,2,41,2,2,4 — the value 22 is hit twice, so Φ\Phi is not injective, and distinct divisors of mn=4mn=4 (namely 1,2,41,2,4, only three of them) do not correspond bijectively to the four pairs. The same failure of injectivity underlies the failure of σk\sigma_k to be completely multiplicative in general. This is exactly why the definition of multiplicative function restricts to coprime arguments: it is the coprimality that makes the divisor-pairing bijection work.

Scope, edge cases & common traps

SituationWhat holdsWhat can fail
gcd⁡(m,n)=1\gcd(m,n)=1d(mn)=d(m)d(n)d(mn)=d(m)d(n), σk(mn)=σk(m)σk(n)\sigma_k(mn)=\sigma_k(m)\sigma_k(n)—
gcd⁡(m,n)>1\gcd(m,n)>1Prime factorization formula still fully determines d(n),σk(n)d(n),\sigma_k(n) from scratchd(mn)=d(m)d(n)d(mn)=d(m)d(n) generally false (see counterexample)
n=1n=1d(1)=1=σk(1)d(1)=1=\sigma_k(1) by convention (empty divisor sum beyond the single divisor 1)Forgetting n=1n=1 as base case breaks induction
k=0k=0σ0(n)=d(n)\sigma_0(n)=d(n); geometric series formula degenerates (ratio p0=1p^0=1), must count directlyPlugging k=0k=0 into pk(a+1)−1pk−1\frac{p^{k(a+1)}-1}{p^k-1} gives 00\tfrac00, undefined — must use the direct count a+1a+1 instead
Negative or complex kkFormulas hold verbatim (σk(n)=∑e∣nek\sigma_k(n)=\sum_{e\mid n}e^k, geometric sum still valid since pk≠1p^k\ne1 for real k≠0k\ne0)None, as long as k≠0k\ne 0

The mathematician behind it

Origins · 1 minLeonhard Euler and how this was discovered
LE
Leonhard Euler
1707–1783 · 18th-century Basel/Berlin/St. Petersburg analytic number theory

Euler was the first to systematically study σ(n)\sigma(n) in connection with perfect numbers, proving the converse direction of the Euclid–Euler theorem: every even perfect number has the form 2p−1(2p−1)2^{p-1}(2^p-1) where 2p−12^p-1 is a Mersenne prime. His techniques for manipulating divisor sums and his introduction of what we would now call Euler products laid the groundwork for treating dd and σk\sigma_k as coefficients of the analytic objects — Dirichlet series — that later number theorists would use to study their average behavior.

History
- 300 BCE — Euclid proves that if 2p−12^p-1 is prime then 2p−1(2p−1)2^{p-1}(2^p-1) is perfect, the first structural fact about σ\sigma.
- 1638 — Descartes and Fermat correspond on amicable numbers and divisor sums, expanding interest in σ(n)\sigma(n).
- 1747 — Euler proves the converse: every even perfect number has Euclid's form, completing the Euclid–Euler theorem.
- 1837 — Dirichlet develops the analytic apparatus (Dirichlet series, the hyperbola method) that gives d(n)d(n) and σk(n)\sigma_k(n) their asymptotic average-order theory.
- 1859 — Riemann's work on ζ(s)\zeta(s) formalizes the Euler product viewpoint underlying ∑d(n)n−s=ζ(s)2\sum d(n)n^{-s} = \zeta(s)^2.
Is d(n)d(n) ever equal to σk(n)\sigma_k(n) for k≠0k \ne 0?

Generically no, since σk(n)\sigma_k(n) grows with nn while d(n)d(n) grows extremely slowly (roughly like no(1)n^{o(1)}), but they can coincide for small special nn. For example n=1n=1 gives d(1)=σk(1)=1d(1)=\sigma_k(1)=1 for every kk. For n=2n=2, d(2)=2d(2)=2 and σ1(2)=1+2=3\sigma_1(2)=1+2=3, already unequal. Because σk(n)≥nk+1>d(n)\sigma_k(n) \ge n^k+1 > d(n) for essentially all n>1n>1 once k≥1k\ge 1, exact coincidences beyond n=1n=1 are rare accidents rather than a pattern, and there is no clean characterization of when they occur.

Why is σ0(n)=d(n)\sigma_0(n) = d(n) specifically, and not something else?

By definition σk(n)=∑e∣nek\sigma_k(n) = \sum_{e\mid n} e^k. Setting k=0k=0 gives σ0(n)=∑e∣ne0=∑e∣n1\sigma_0(n) = \sum_{e \mid n} e^0 = \sum_{e\mid n} 1, since any positive real number raised to the 00 power is 11. That sum is precisely the count of divisors, which is the definition of d(n)d(n). So σ0=d\sigma_0 = d is not a coincidence but a direct algebraic consequence of the general definition, unifying divisor-counting and divisor-summing as the k=0k=0 and k=1k=1 instances of one family.

Does the multiplicativity theorem apply to functions other than dd and σk\sigma_k?

Yes — the theorem is stated for any multiplicative ff, and d,σkd,\sigma_k are just the two most common instances (from f(e)=1f(e)=1 and f(e)=ekf(e)=e^k). The same mechanism proves that Euler's totient function φ(n)\varphi(n), viewed via n=∑e∣nφ(e)n = \sum_{e\mid n}\varphi(e), is consistent with multiplicativity, and it underlies the multiplicativity of the Möbius function's summatory identities. This is the general content of the theory of Multiplicative Functions: divisor sums of multiplicative functions are multiplicative.

How do you compute d(n)d(n) or σk(n)\sigma_k(n) efficiently for a large nn?

Factor nn into primes, then apply the closed-form product formulas. The bottleneck is factoring nn itself, which for very large nn is computationally hard (this hardness is exactly what RSA cryptography relies on). Once the factorization n=p1a1⋯prarn = p_1^{a_1}\cdots p_r^{a_r} is known, computing d(n)=∏(ai+1)d(n)=\prod(a_i+1) and σk(n)=∏pik(ai+1)−1pik−1\sigma_k(n) = \prod \frac{p_i^{k(a_i+1)}-1}{p_i^k-1} takes only a handful of arithmetic operations, since each factor is a simple closed-form expression rather than a sum over potentially huge numbers of divisors.

Are d(n)d(n) and σk(n)\sigma_k(n) ever negative or non-integer?

For positive integer nn and integer k≥0k \ge 0, d(n)d(n) and σk(n)\sigma_k(n) are always positive integers, since they are finite sums of positive integer powers of positive integer divisors. For negative or non-integer kk, σk(n)\sigma_k(n) can be a positive real number that is not an integer — for instance σ−1(n)=∑e∣ne−1\sigma_{-1}(n) = \sum_{e\mid n} e^{-1} is generally a fraction. Interestingly σ−1(n)=σ1(n)/n\sigma_{-1}(n) = \sigma_1(n)/n exactly, since divisors pair up as e↔n/ee \leftrightarrow n/e, giving a clean identity relating σ−1\sigma_{-1} to σ1\sigma_1.

What's the connection between σ(n)\sigma(n) and perfect numbers?

By definition nn is perfect exactly when σ(n)=2n\sigma(n) = 2n, since σ(n)\sigma(n) sums all divisors including nn itself, so σ(n)−n\sigma(n)-n is the sum of proper divisors; the perfect number condition "nn equals the sum of its proper divisors" becomes n=σ(n)−nn = \sigma(n)-n, i.e. σ(n)=2n\sigma(n)=2n. The Euclid–Euler theorem characterizes all even perfect numbers as exactly the integers 2p−1(2p−1)2^{p-1}(2^p-1) for Mersenne primes 2p−12^p-1; whether any odd perfect number exists remains a famous open problem in number theory.

Why does multiplicativity reduce everything to prime powers?

Because every n>1n>1 factors uniquely as a product of prime powers with pairwise-coprime prime bases (Fundamental Theorem of Arithmetic), and multiplicativity says ff applied to such a product equals the product of ff applied to each prime-power factor. So knowing ff on every prime power pap^a completely determines f(n)f(n) for every nn, via one multiplication per distinct prime factor. This is what converts an infinite family of individually mysterious values f(n)f(n) into a finite, checkable rule on prime powers.

Before this

Where this leads