A perfect number equals the sum of its proper divisors (6 = 1+2+3). Write perfect_upto(n) returning all perfect numbers from 1 to n.
perfect_upto(30) → [6, 28]
perfect_upto(5) → []
Submit runs 4 tests, including hidden edge cases.
Run your code to see the output here.