|
1 | | -The Greek mathematican Nicomachus devised a classification scheme for |
2 | | -natural numbers, identifying each as belonging uniquely to the |
3 | | -categories of _abundant_, _perfect_, or _deficient_. A perfect number |
4 | | -equals the sum of its positive divisors — the pairs of numbers whose |
5 | | -product yields the target number, excluding the number itself. |
6 | | - |
7 | | -- Perfect: Sum of factors = number |
8 | | -- Abundant: Sum of factors > number |
9 | | -- Deficient: Sum of factors < number |
10 | | - |
11 | | -The Aliquot sum is defined as the sum of the factors of a number not |
12 | | -including the number itself. |
13 | | - |
14 | | -## Examples |
15 | | - |
16 | | -- 6 is a perfect number because its divisors are 1, 2, 3 and 6 = 1 + 2 + |
17 | | - 3. |
18 | | -- 28 is a perfect number because 28 = 1 + 2 + 4 + 7 + 14. |
19 | | -- Prime numbers 7, 13, etc are considered deficient in the Nicomachus |
20 | | - classification. |
| 1 | +The Greek mathematican [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum](https://en.wikipedia.org/wiki/Aliquot_sum). The aliquot sum is defined as the sum of the factors of a number not including the number itself. For example, the aliquot sum of 15 is (1 + 3 + 5) = 9 |
| 2 | + |
| 3 | +- **Perfect**: aliquot sum = number |
| 4 | + - 6 is a perfect number because (1 + 2 + 3) = 6 |
| 5 | + - 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28 |
| 6 | +- **Abundant**: aliquot sum > number |
| 7 | + - 12 is an abundant number because (1 + 2 + 3 + 4 + 6) = 16 |
| 8 | + - 24 is an abundant number because (1 + 2 + 3 + 4 + 6 + 8 + 12) = 36 |
| 9 | +- **Deficient**: aliquot sum < number |
| 10 | + - 8 is a deficient number because (1 + 2 + 4) = 7 |
| 11 | + - Prime numbers are deficient |
| 12 | + |
| 13 | +Implement a way to determine whether a given number is **perfect**. Depending on your language track, you may also need to implement a way to determine whethether a given number is **abundant** or **deficient**. |
0 commit comments