Input a number to determine if it is highly composite, or input a range to generate all highly composite numbers within it.
A highly composite number is a positive integer that has more divisors than any smaller positive integer. In other words, if a number has more factors than any number less than it, it is classified as highly composite.
Solution:
Divisors of 12: 1, 2, 3, 4, 6, 12.
Total divisors: 6
Compare divisor counts for numbers 1 to 11:
1: 1
2: 2
3: 2
4: 3
5: 2
6: 4
7: 2
8: 4
9: 3
10: 4
11: 2
The number 12 has the most divisors (6).
Result: 12 is a highly composite number.
Solution:
Divisors of 24: 1, 2, 3, 4, 6, 8, 12, 24
Total divisors: 8
Compare divisor counts for numbers 1 to 23:
The highest divisor count is 6 (from 12).
8 > 6
Result: 24 is a highly composite number.
Solution:
Divisors of 144: 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 36, 48, 72, 144
Total divisors: 15
Compare divisor counts for numbers 1 to 143:
The highest divisor count is 16 (from 120).
15 < 16
Result: 144 is not a highly composite number.