Determine if input is a perfect number - MATLAB Cody - MATLAB Central

Problem 1012. Determine if input is a perfect number

Difficulty:Rate
A perfect number occurs whent the sum of all divisors of a positive integer, except the number itself, equals the number.
Example
28 = 1 + 2 + 4 + 7 + 14;
so return true
10 ~= 1 + 2 + 5
so return false

Solution Stats

48.59% Correct | 51.41% Incorrect
Last Solution submitted on Nov 12, 2025

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers250

Suggested Problems

More from this Author17

Problem Tags

Community Treasure Hunt

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

Start Hunting!