Perfect Numbers

An integer n greater than zero is perfect if its equal to the sum of its
divisors (except itself). Therefore, 6 is perfect since the sum of its
divisors (but itself) is 1 + 2 + 3 = 6. In contrast, 8 is not perfect
since 1 + 2 + 4 = 7 which is diferent from 8.

Write a function @is_perfect_number(n)@ that given the integer number n
greater than zero determines if n is perfect or not.

Observation

Until 2016 only 49 perfect numbers were known! Probably the same number
that are known nowadays!

Sample session

Problem information

Author: InfBesos

Generation: 2026-01-25T17:05:32.848Z

© Jutge.org, 2006–2026.
https://jutge.org
