Google Interview Question

Varify if the input is a perfect number.