Math Core

Module 3.6 · Number Theory

Divisor functions

How many divisors does 10!10! have? What is the sum of the divisors of 300300 that are multiples of 55? What is the smallest number with 2424 divisors? These questions all come down to the prime factorization and one structural fact: divisor functions are multiplicative, so you can work one prime at a time.

Counting and adding divisors

Every divisor of n=p1e1p2e2⋯pkekn = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k} has the form p1a1⋯pkakp_1^{a_1} \cdots p_k^{a_k} with 0≤ai≤ei0 \le a_i \le e_i, and different exponent choices give different divisors (unique factorization). That gives both formulas below.

Divisor count and divisor sum

For n=p1e1⋯pkekn = p_1^{e_1} \cdots p_k^{e_k}:

d(n)=(e1+1)(e2+1)⋯(ek+1),d(n) = (e_1 + 1)(e_2 + 1)\cdots(e_k + 1),

σ(n)=∏i=1k(1+pi+pi2+⋯+piei)=∏i=1kpiei+1−1pi−1.\sigma(n) = \prod_{i=1}^{k}\left(1 + p_i + p_i^2 + \cdots + p_i^{e_i}\right) = \prod_{i=1}^{k} \frac{p_i^{e_i + 1} - 1}{p_i - 1}.

Why the sum formula works. Expand the product ∏(1+pi+⋯+piei)\prod (1 + p_i + \cdots + p_i^{e_i}). Each term of the expansion picks one power piaip_i^{a_i} from each factor and multiplies them, which is exactly one divisor. Every divisor appears exactly once. So the expansion is the sum of all divisors.

The same "expand a product" idea lets you sum any restricted set of divisors. For divisors that are multiples of 55, use (5+25+⋯ )(5 + 25 + \cdots) in the 55-factor instead of (1+5+25+⋯ )(1 + 5 + 25 + \cdots). For odd divisors, drop the 22-factor entirely.

Multiplicativity

Definition

Multiplicative function

A function ff on positive integers is multiplicative if f(mn)=f(m)f(n)f(mn) = f(m) f(n) whenever gcd⁡(m,n)=1\gcd(m, n) = 1.

dd, σ\sigma and φ\varphi are all multiplicative: when gcd⁡(m,n)=1\gcd(m, n) = 1, each divisor of mnmn splits uniquely as (divisor of mm) times (divisor of nn). So to compute one of them, compute it on each prime power and multiply.

Product of divisors

Pair each divisor tt of nn with n/tn/t. Each pair multiplies to nn, so

∏t∣nt=nd(n)/2.\prod_{t \mid n} t = n^{d(n)/2}.

(When nn is a perfect square, n\sqrt n pairs with itself and the formula still holds.)

Parity facts

  • d(n)d(n) is odd exactly when nn is a perfect square: divisors pair up as t↔n/tt \leftrightarrow n/t except n\sqrt n.
  • σ(n)\sigma(n) is odd exactly when nn is a square or twice a square. For odd pp, 1+p+⋯+pe1 + p + \cdots + p^e has e+1e + 1 odd terms, so it's odd iff ee is even. The factor for p=2p = 2 is always odd.

Perfect and abundant numbers

nn is perfect if σ(n)=2n\sigma(n) = 2n and abundant if σ(n)>2n\sigma(n) > 2n. The ratio σ(n)n=∑t∣n1t\dfrac{\sigma(n)}{n} = \sum_{t \mid n} \dfrac{1}{t} is also multiplicative, and for a prime power it is less than pp−1\dfrac{p}{p-1}. This is the tool for abundance questions.

Euclid showed that if 2k−12^k - 1 is prime then 2k−1(2k−1)2^{k-1}(2^k - 1) is perfect: σ=(2k−1)⋅2k=2⋅2k−1(2k−1)\sigma = (2^k - 1) \cdot 2^k = 2 \cdot 2^{k-1}(2^k - 1). Euler proved every even perfect number has this form: 6,28,496,8128,…6, 28, 496, 8128, \dots

Worked example: Counting divisors

How many positive divisors does 202632026^3 have?

2026=2⋅10132026 = 2 \cdot 1013 with 10131013 prime, so 20263=23⋅101332026^3 = 2^3 \cdot 1013^3 and d=4⋅4=16d = 4 \cdot 4 = 16.

Worked example: Smallest number with a given divisor count

Find the smallest positive integer with exactly 1212 divisors.

Write 1212 as a product of factors ei+1e_i + 1: 1212, 6⋅26 \cdot 2, 4⋅34 \cdot 3, 3⋅2⋅23 \cdot 2 \cdot 2. Give the largest exponents to the smallest primes:

211=20482^{11} = 2048,  25⋅3=96\ 2^5 \cdot 3 = 96,  23⋅32=72\ 2^3 \cdot 3^2 = 72,  22⋅3⋅5=60\ 2^2 \cdot 3 \cdot 5 = 60.

The smallest is 6060.

Worked example: Counting lcm pairs

How many ordered pairs (a,b)(a, b) of positive integers have lcm⁡(a,b)=23⋅52\operatorname{lcm}(a, b) = 2^3 \cdot 5^2?

Work one prime at a time. For 22: exponents (i,j)(i, j) with max⁡(i,j)=3\max(i, j) = 3 and 0≤i,j≤30 \le i, j \le 3. There are 42−32=74^2 - 3^2 = 7 such pairs. For 55: 32−22=53^2 - 2^2 = 5. In general a prime power pep^e contributes 2e+12e + 1. The answer is 7⋅5=357 \cdot 5 = 35.

Worked example: Divisors of a square

For n=24⋅32n = 2^4 \cdot 3^2, how many divisors of n2n^2 are less than nn?

n2=28⋅34n^2 = 2^8 \cdot 3^4 has 9⋅5=459 \cdot 5 = 45 divisors. They pair up as t↔n2/tt \leftrightarrow n^2/t, one smaller than nn and one larger, except t=nt = n. So 45−12=22\frac{45 - 1}{2} = 22 are less than nn.

Common mistake

To minimize a number with a given divisor count, don't automatically use the most primes. Compare every factorization of the count, as in the example: 22⋅3⋅5=602^2 \cdot 3 \cdot 5 = 60 beats 23⋅32=722^3 \cdot 3^2 = 72 here, but for d=8d = 8, 23⋅3=242^3 \cdot 3 = 24 beats 2⋅3⋅5=302 \cdot 3 \cdot 5 = 30.

Practice

Practice 1

How many positive divisors does 10!10! have?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Find the sum of all positive divisors of 300300 that are multiples of 55.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Find the smallest positive integer with exactly 2424 positive divisors.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

For how many integers nn with 1<n≤2001 < n \le 200 is the product of all positive divisors of nn equal to n3n^3?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

How many positive divisors of 30430^4 are perfect squares or perfect cubes (or both)?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

How many ordered pairs (a,b)(a, b) of positive integers satisfy lcm⁡(a,b)=24⋅33⋅52\operatorname{lcm}(a, b) = 2^4 \cdot 3^3 \cdot 5^2?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

For how many positive integers n≤1000n \le 1000 is σ(n)\sigma(n), the sum of the positive divisors of nn, odd?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Find the smallest odd positive integer nn with σ(n)>2n\sigma(n) > 2n.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Real contest practice