calculate perfect number