Given an integer N which denotes the number of divisors of any number, the task is to find the maximum prime divisors that are possible in number having N divisors.
Input: N = 4
Input: N = 8
Approach: The idea is to find the prime factorization of the number N, then the sum of the powers of the prime divisors is the maximum possible prime divisors of a number can have with N divisors.
Let the number of divisors of number be 4, Then the possible numbers can be 6, 10, 15,... Divisors of 6 = 1, 2, 3, 6 Total number of prime-divisors = 2 (2, 3) Prime Factorization of 4 = 22 Sum of powers of prime factors = 2
Below is the implementation of the above approach:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Count of numbers below N whose sum of prime divisors is K
- Sum of all prime divisors of all the numbers in range L-R
- Numbers in range [L, R] such that the count of their divisors is both even and prime
- Sum of numbers in a range [L, R] whose count of divisors is prime
- Find sum of inverse of the divisors when sum of divisors and the number is given
- Find sum of divisors of all the divisors of a natural number
- Sum of all the prime divisors of a number
- Count of the non-prime divisors of a given number
- Generating all divisors of a number using its prime factorization
- Check if a number can be expressed as a product of exactly K prime divisors
- Numbers with exactly 3 divisors
- Common divisors of N numbers
- Common Divisors of Two Numbers
- Check if sum of divisors of two numbers are same
- Sum of common divisors of two numbers A and B
- Maximum count of common divisors of A and B such that all are co-primes to one another
- Sum of all perfect square divisors of numbers from 1 to N
- C++ Program for Common Divisors of Two Numbers
- Find numbers with n-divisors in a given range
- Find numbers with K odd divisors in a given range
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.