Math Core

Module 3.4 · Number Theory

Counting divisors

"How many positive divisors does 720720 have?" Listing them one by one is slow and easy to botch. With the prime factorization in hand, you can count them in one line and answer related questions too: how many are odd, how many are perfect squares, and what they add up to.

The divisor-counting formula

Take 72=23⋅3272 = 2^3 \cdot 3^2. Any divisor of 7272 can use only the primes 22 and 33, and no more of each than 7272 has. So every divisor looks like 2a⋅3bwith a∈{0,1,2,3} and b∈{0,1,2}.2^a \cdot 3^b \quad \text{with } a \in \{0, 1, 2, 3\} \text{ and } b \in \{0, 1, 2\}. There are 44 choices for aa and 33 for bb, and each pair gives a different divisor (by unique factorization). So 7272 has 4×3=124 \times 3 = 12 divisors.

Number of divisors

If n=p1e1⋅p2e2⋯pkekn = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}, then the number of positive divisors of nn is (e1+1)(e2+1)⋯(ek+1).(e_1 + 1)(e_2 + 1) \cdots (e_k + 1).

Common mistake

The "+1+1" is there because an exponent of 00 is allowed. Students who multiply the exponents themselves (3×2=63 \times 2 = 6 for 7272) get the wrong answer. Also make sure you've factored all the way into primes: writing 72=8⋅972 = 8 \cdot 9 and computing 2×22 \times 2 is wrong.

Worked example: Count them all

How many positive divisors does 720720 have?

720=24⋅32⋅5720 = 2^4 \cdot 3^2 \cdot 5, so it has (4+1)(2+1)(1+1)=5⋅3⋅2=30(4+1)(2+1)(1+1) = 5 \cdot 3 \cdot 2 = 30 divisors.

Divisors with a condition

Restrict the choice of exponents.

  • Odd divisors: force the exponent of 22 to be 00.
  • Even divisors: total minus odd, or force the exponent of 22 to be at least 11.
  • Multiples of mm: force each exponent to be at least what mm needs.
  • Perfect-square divisors: allow only even exponents.

Worked example: Even divisors

How many positive divisors of 720720 are even?

Odd divisors of 720=24⋅32⋅5720 = 2^4 \cdot 3^2 \cdot 5 use 202^0 only: 1⋅3⋅2=61 \cdot 3 \cdot 2 = 6 of them. So there are 30−6=2430 - 6 = 24 even divisors. (Or directly: the exponent of 22 is one of 1,2,3,41, 2, 3, 4, giving 4⋅3⋅2=244 \cdot 3 \cdot 2 = 24.)

Sum of divisors

Multiply out (1+2+4)(1+3+9)(1 + 2 + 4)(1 + 3 + 9). Each term of the expansion is one choice from each bracket, like 4⋅3=124 \cdot 3 = 12. So you get every divisor of 22⋅32=362^2 \cdot 3^2 = 36 exactly once, and the product is their sum.

Worked example: Sum of divisors

What is the sum of the positive divisors of 180180?

180=22⋅32⋅5180 = 2^2 \cdot 3^2 \cdot 5, so the sum is (1+2+4)(1+3+9)(1+5)=7⋅13⋅6=546(1 + 2 + 4)(1 + 3 + 9)(1 + 5) = 7 \cdot 13 \cdot 6 = 546.

Odd numbers of divisors

Divisors come in pairs: dd pairs with nd\dfrac{n}{d}. For 3636: 1⋅361 \cdot 36, 2⋅182 \cdot 18, 3⋅123 \cdot 12, 4⋅94 \cdot 9, and then 6⋅66 \cdot 6, which pairs 66 with itself. A number has an odd number of divisors exactly when it is a perfect square. This matches the formula: all eie_i even means every factor ei+1e_i + 1 is odd.

Tip

Numbers with exactly 33 divisors are squares of primes (4,9,25,49,…4, 9, 25, 49, \dots), since 3=2+13 = 2 + 1 forces n=p2n = p^2. In general, factor the target count to see what shapes nn can take: exactly 66 divisors means n=p5n = p^5 or n=p2qn = p^2 q.

Practice

Practice 1

How many positive divisors does 360360 have?

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

Practice 2

How many positive divisors of 12601260 are odd?

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

Practice 3

What is the sum of all positive divisors of 7272?

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

Practice 4

How many integers from 11 to 100100 have an odd number of positive divisors?

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

Practice 5

How many positive integers less than 5050 have exactly three positive divisors?

Practice 6

What is the smallest positive integer with exactly 1212 positive divisors?

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

Practice 7

How many positive divisors of 36003600 are perfect squares?

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

Practice 8

How many positive divisors of 1,000,0001{,}000{,}000 are multiples of 100100?

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

Real contest practice