Amicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number. (A proper divisor of a number is a positive factor of that number other than the number itself.
Input : x = 220, y = 284 Output : Yes Proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110. Sum of these is 284. Proper divisors of 284 are 1, 2, 4, 71 and 142 with sum 220. Input : 1 2 Output :No
The logic is very simple. We compare sum of the proper divisors of both numbers and compare sum for one number with other number.
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.
- Find the sum of the all amicable numbers up to N
- Check if the given two numbers are friendly pair or not
- Check if count of divisors is even or odd
- C Program to Check if count of divisors is even or odd
- Java Program to Check if count of divisors is even or odd
- Check if sum of divisors of two numbers are same
- Check if frequency of character in one string is a factor or multiple of frequency of same character in other string
- Check if a number can be expressed as sum two abundant numbers
- Check if the given array contains all the divisors of some integer
- Check if count of even divisors of N is equal to count of odd divisors
- Check if a number exists with X divisors out of which Y are composite
- Largest odd divisor Game to check which player wins
- Check if a number has an odd count of odd divisors and even count of even divisors
- Minimum repeated addition of even divisors of N required to convert N to M
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.