Highly Composite Number Calculator
Check whether a number sets a new record for divisor count among all smaller integers.
What it does
A highly composite number has more divisors than any smaller positive integer. The sequence begins 1, 2, 4, 6, 12, 24 and 36. Each entry is a new record holder for the divisor count, and the next entry must exceed it strictly rather than merely match it.
The concept was introduced by the mathematician Srinivasa Ramanujan, who studied these numbers alongside their close relatives, the superabundant numbers. They appear naturally when looking for integers with unusually many factors relative to their size.
Testing the property directly means counting divisors for every number up to n and keeping a running maximum. This page uses a sieve to compute all those counts in one pass, so the whole comparison is fast and exact for inputs up to one hundred thousand.
The output shows the divisor count of your number, the best count achieved by any smaller number and the resulting classification. A number with the same count as an earlier record is not highly composite, because the record was not broken.
The upper limit is chosen to keep the sieve small in a browser. Results are exact integers, and the tool reports a clear error outside the allowed range.
How to use
- Enter a whole number n from 1 to 100,000.
- Read the classification in the main result box.
- Check the divisor count of your number beside it.
- Compare with the earlier record to see why the verdict was reached.
- The default n = 12 reproduces the worked example.
- Try n = 24 to see another record holder, then n = 18 for a non example.
Formula
- n
- The candidate integer.
- d(n)
- The number of positive divisors of n.
- d(k)
- The divisor count of a smaller integer k.
The sieve marks each multiple of i as having i as a divisor, which builds every d value up to n in one pass. The running maximum of the earlier values is the earlier record. Equality with that record is not enough, because the definition requires a strict increase.
Worked example
Example: n = 12
The page opens with n = 12.
- Count divisors from 1 upward, keeping the best so far.
- The number 1 has 1 divisor, setting the first record.
- The number 2 has 2 divisors, a new record.
- The number 4 has 3 divisors, a new record.
- The number 6 has 4 divisors, a new record.
- The number 12 has 6 divisors, which beats 4.
- The tool reports 6 divisors, earlier record 4, and Highly composite.
Reference table
| n | Divisor count | Earlier record | Highly composite |
|---|---|---|---|
| 1 | 1 | n/a | Yes |
| 2 | 2 | 1 | Yes |
| 4 | 3 | 2 | Yes |
| 6 | 4 | 3 | Yes |
| 12 | 6 | 4 | Yes |
| 18 | 6 | 6 | No |
| 24 | 8 | 6 | Yes |
Limits
- Inputs above 100,000 are rejected to keep the sieve fast.
- Ties with an earlier record are treated as failures, following the strict definition.
- The tool checks one number, it does not list the whole sequence up to n.
- Only positive integers are considered.
Common mistakes
- Treating a tie as a new record.
- Comparing with the immediately previous integer rather than all smaller integers.
- Confusing divisor count with the sum of divisors.
- Assuming every even number is highly composite.
- Counting only prime factors instead of all divisors.
Try it yourself
Quick checks. Answers sit tucked under each question.
Is 12 highly composite?
Yes. It has 6 divisors, beating the earlier record of 4 held by 6.
Is 18 highly composite?
No. It also has 6 divisors, which only ties the record set by 12.
Is 24 highly composite?
Yes. It has 8 divisors, a strict improvement on 6.
Questions
Who introduced these numbers?
Srinivasa Ramanujan studied them in his work on highly composite and related numbers.
Does a tie count?
No. The divisor count must be strictly greater than every earlier value.
How are divisor counts computed?
A sieve counts how many times each integer divides numbers up to n.
What is the first record holder after 12?
24, with 8 divisors.
Are results exact?
Yes. The sieve uses integer arithmetic only.
What is the largest input?
One hundred thousand.