Added the perfect number calculation