[perfect-number] improved code consistency and readability