Amicable pair - MATLAB Cody - MATLAB Central

Problem 45424. Amicable pair

Difficulty:Rate
Amicable numbers are two different numbers such that the sum of the proper divisors of each is equal to the other number.
For example,
220 = 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 ; sum =284
284 = 1, 2, 4, 71, 142 ; sum =220
So, 220 & 284 make an amicable pair.
Find the number of such pairs within n.
Update - Test cases added at 09-09-22

Solution Stats

50.0% Correct | 50.0% Incorrect
Last Solution submitted on Jun 19, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers7

Suggested Problems

More from this Author174

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!