title: 'Abundant, deficient and perfect number classifications'
id: 594810f028c0303b75339acd
challengeType: 5
---
## Description
<sectionid='description'>
<p>These define three classifications of positive integers based on their <ahref="http://rosettacode.org/wiki/Proper divisors"title="Proper divisors">proper divisors</a>.</p>
<p>Let $P(n)$ be the sum of the proper divisors of n where proper divisors are all positive integers n other than n itself.</p>
<p>If <code>P(n) <n</code> then n is classed as "deficient"</p>
<p>If <code>P(n) === n</code> then n is classed as "perfect"</p>
<p>If <code>P(n) > n</code> then n is classed as "abundant"</p>
<p>Example:</p>
<p>6 has proper divisors of 1, 2, and 3.</p>
<p>1 + 2 + 3 = 6, so 6 is classed as a perfect number.</p>
<p>Implement a function that calculates how many of the integers from 1 to 20,000 (inclusive) are in each of the three classes. Output the result as an array in the following format <code>[deficient, perfect, abundant]</code>.</p>