Given two numbers n1 & n2, We need to check whether these numbers are equivalent numbers or not.
Equivalent numbers are numbers such that the sums of their proper divisors are the same.
For example, 159, 559, and 703 are equivalent numbers. This is because all the three numbers have 57 as the sum of their proper divisors.
Input : n1 = 559, n2 = 703
Output : Yes.
Explanation: Both numbers have 57 as a sum of their proper divisors.
Input : n1 = 36, n2 = 57
Output : No.
Explanation: 36 has sum 55 while 57 has sum 23 of their proper divisors.
Find the sum of proper divisors as implemented in for Perfect number for the given numbers and then will check if both sums are equal or not.
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.
- Maximum possible prime divisors that can exist in numbers having exactly N divisors
- Check if count of even divisors of N is equal to count of odd divisors
- Numbers with exactly 3 divisors
- Check if count of divisors is even or odd
- Common divisors of N numbers
- Sum of common divisors of two numbers A and B
- Common Divisors of Two Numbers
- Check if the given array contains all the divisors of some integer
- C Program to Check if count of divisors is even or odd
- Count of numbers below N whose sum of prime divisors is K
- Sum of all perfect square divisors of numbers from 1 to N
- Divide the two given numbers by their common divisors
- 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
- Find all divisors of first N natural numbers
- Number of divisors of product of N numbers
- Java Program to Check if count of divisors is even or odd
- Check if a number exists with X divisors out of which Y are composite
- Sum of numbers in a range [L, R] whose count of divisors is prime
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.