```
class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
if num <= 1:
return False
cum = cur = 1
while cur < int(math.sqrt(num)):
cur += 1
if num % cur == 0:
cum += cur + num / cur
return num == cum
```