Which Number Has the Most Divisors?

  • Medium
  • Number puzzles
  • Tests: Counting divisors from the prime factorisation

The puzzle

Which whole number below 100 has the most divisors, and how many does it have?

Testing all 99 by hand is possible but there is a formula that makes it quick.

Stuck?

One at a time, smallest first. Open only as many as you need — the whole point of the puzzle is the part you work out yourself.

Hint 1

Write a number as a product of prime powers. The divisor count depends only on the exponents.

Hint 2

If n = p^a × q^b then n has (a+1)(b+1) divisors - you choose how many of each prime to include.

Show the answer Hide the answer

Twelve divisors, achieved by five numbers: 60, 72, 84, 90 and 96. No number below 100 has more.

How to get there

A divisor of p^a × q^b is p^i × q^j with 0 ≤ i ≤ a and 0 ≤ j ≤ b, so there are (a+1)(b+1) of them. For 96 = 2^5 × 3, that is (5+1)(1+1) = 12.

The same count for the others: 60 = 2²×3×5 gives 3×2×2 = 12; 72 = 2³×3² gives 4×3 = 12; 84 = 2²×3×7 gives 12; 90 = 2×3²×5 gives 12.

Note what loses. 97 is prime and has 2 divisors. 64 = 2^6 has only 7, despite being large - one prime raised high is far worse than several primes raised a little. That is why highly composite numbers like 60 and 360 use many small primes, and why 60 was chosen for minutes and seconds.

The technique worth keeping

Count divisors by adding one to each exponent in the prime factorisation and multiplying. To maximise the count for a given size, spread the factorisation across several small primes rather than concentrating it in one.