The first few Primitive Abundant Numbers are:
20, 70, 88, 104, 272, 304………
Check if N is a Primitive Abundant Number
Given a number N, the task is to find if this number is Primitive Abundant Number or not.
Input: N = 20
Sum of 20’s proper divisors is – 1 + 2 + 4 + 5 + 10 = 22 > 20,
So, 20 is an abundant number.
The proper divisors of 1, 2, 4, 5 and 10 are0, 1, 3, 1 and 8 respectively,
Each of these numbers is a deficient number
Therefore, 20 is a primitive abundant number.
Input: N = 17
- Check if the number is an Abundant number or not, i.e, sum of all the proper divisors of the number denoted by sum(N) is greater than the value of the number N
- If the number is not abundant then return false else do the following
- Check if all proper divisors of N are Deficient Numbers or not, i.e, sum of all the divisors of the number denoted by divisorsSum(n) is less than twice the value of the number N.
- If both above conditions are true print “Yes” else print “No.
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Abundant Number
- Check if a number can be expressed as sum two abundant numbers
- Primitive root of a prime number n modulo n
- Find the number of primitive roots modulo prime
- Number of factors of very large number N modulo M where M is any prime number
- Find the largest number smaller than integer N with maximum number of set bits
- Count number of trailing zeros in Binary representation of a number using Bitset
- Minimum number of distinct powers of 2 required to express a given binary number
- Find minimum number to be divided to make a number a perfect square
- Count number of triplets with product equal to given number with duplicates allowed
- Find the minimum number to be added to N to make it a prime number
- Minimum number of swaps required to make a number divisible by 60
- Previous perfect square and cube number smaller than number N
- Given number of matches played, find number of teams in tournament
- Minimum divisor of a number to make the number perfect cube
- Find the number of positive integers less than or equal to N that have an odd number of digits
- Number of times the largest perfect square number can be subtracted from N
- Find smallest possible Number from a given large Number with same count of digits
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Number of ways to split a binary number such that every part is divisible by 2
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.