Background:
The current Perfect Numbers challenge is rather flawed and complicated, since it asks you to output in a complex format involving the factors of the number. This is a purely decision-problem repost of the challenge.
Challenge
Given a positive integer through any standard input format, distinguish between whether it is perfect or not.
A perfect number is a number that is equal to the sum of all its proper divisors (its positive divisors less than itself). For example, \6ドル\$ is a perfect number, since its divisors are \1,2,3ドル\$, which sum up to \6ドル\$, while \12ドル\$ is not a perfect number since its divisors ( \1,2,3,4,6ドル\$ ) sum up to \16ドル\$, not \12ドル\$.
Test Cases:
Imperfect:
1,12,13,18,20,1000,33550335
Perfect:
6,28,496,8128,33550336,8589869056
Rules
- Your program doesn't have to complete the larger test cases, if there's memory or time constraints, but it should be theoretically able to if it were given more memory/time.
- Output can be two distinct and consistent values through any allowed output format. If it isn't immediately obvious what represents Perfect/Imperfect, please make sure to specify in your answer.
jcinstruction even though it'd save 2 bytes, because I really like having a single routine that handles both abundant and perfect numbers, and also would work with any operand size (not just 32 bits)... but yep, you have a point, technically I could drop 2 bytes this way. But that would be like hard-coding the perfect numbers rather than detecting them. \$\endgroup\$