Dsa
Math
Easy
Friendly Number Pairs
Two numbers A and B are called friendly if the sum of the proper divisors of A equals B and the sum of the proper divisors of B equals A. Your task is to write a program that takes two integers A and B, and checks whether they are friendly numbers.
Input Format:
- Two integers A and B (1 <= A, B <= 10000)
Output Format:
- 'Yes' if they are friendly numbers, 'No' otherwise.
Example:
Input:
220 284
Output:
Yes
Key concepts
mathdivisors
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now