Given a positive integer N, the task is to tell whether it’s an anti-prime number or not.
Anti-Prime Numbers (Highly Composite Number):
A positive integer that has more divisors than any positive number smaller than it, is called an Anti-Prime Number (also known as Highly Composite Number).
Following is the list of the first 10 anti-prime numbers along with their prime factorizations:
Input: N = 5040 Output: 5040 is anti-prime Explanation: There is no positive integer less than 5040 having number of divisors more than or equal to the number of divisors of 5040.
Input: N = 72 Output: 72 is not anti-prime
This question can be solved by counting the number of divisors of the current number and then counting the number of divisors for each number less than it and checking whether any number has the number of divisors greater than or equal to the number of divisors of N.