Problem 60346. Classify numbers as abundant, deficient, or perfect
A number is perfect if the sum of its proper divisors (i.e., divisors excluding the number itself) is equal to itself. For example, 28 is perfect because 1+2+4+7+14 = 28. Cody Problems 1012, 2544, and 47458 deal with the perfect numbers.
If the sum of proper divisors is less than the number, it is called deficient, and if it is greater than the number, it is abundant. For example, 21 is deficient (1+3+7 = 11 < 21) and 24 is abundant (1+2+3+4+6+8+12 = 36).
Write a function to classify numbers as abundant, deficient, or perfect.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
Swap the first and last columns
20438 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1820 Solvers
-
1423 Solvers
-
253 Solvers
-
Sum of diagonals elements of a matrix
222 Solvers
More from this Author279
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!