Google interview question

Varify if the input is a perfect number.