These define three classifications of positive integers based on their   proper divisors.

Let   P(n)   be the sum of the proper divisors of   n   where the proper divisors are all positive divisors of   n   other than   n   itself.

   if    P(n) <  n    then  n  is classed as  deficient  (OEIS A005100).
   if    P(n) == n    then  n  is classed as  perfect    (OEIS A000396).
   if    P(n) >  n    then  n  is classed as  abundant   (OEIS A005101).



Example

6   has proper divisors of   1,   2,   and   3.

1 + 2 + 3 = 6,   so   6   is classed as a perfect number.



Task

Calculate how many of the integers   1   to   20,000   (inclusive) are in each of the three classes.

Show the results here.



Related tasks

   Aliquot sequence classifications.   (The whole series from which this task is a subset.)
   Proper divisors
   Amicable pairs


( clk$:?t0
& ( multiples
  =   prime multiplicity
    .     !arg:(?prime.?multiplicity)
        & !multiplicity:0
        & 1
      |   !prime^!multiplicity*(.!multiplicity)
        + multiples$(!prime.-1+!multiplicity)
  )
& ( P
  =   primeFactors prime exp poly S
    .   !arg^1/67:?primeFactors
      & ( !primeFactors:?^1/67&0
        |   1:?poly
          &   whl
            ' ( !primeFactors:%?prime^?exp*?primeFactors
              & !poly*multiples$(!prime.67*!exp):?poly
              )
          & -1+!poly+1:?poly
          & 1:?S
          & (   !poly
              :   ?
                + (#%@?s*?&!S+!s:?S&~)
                + ?
            | 1/2*!S
            )
        )
  )
& 0:?deficient:?perfect:?abundant
& 0:?n
&   whl
  ' ( 1+!n:~>20000:?n
    &   P$!n
      : ( <!n&1+!deficient:?deficient
        | !n&1+!perfect:?perfect
        | >!n&1+!abundant:?abundant
        )
    )
& out$(deficient !deficient perfect !perfect abundant !abundant)
& clk$:?t1
& out$(flt$(!t1+-1*!t0,2) sec)
& clk$:?t2
& ( P
  =   f h S
    .   0:?f
      & 0:?S
      &   whl
        ' ( 1+!f:?f
          & !f^2:~>!n
          & (   !arg*!f^-1:~/:?g
              & !S+!f:?S
              & ( !g:~!f&!S+!g:?S
                | 
                )
            | 
            )
          )
      & 1/2*!S
  )
& 0:?deficient:?perfect:?abundant
& 0:?n
&   whl
  ' ( 1+!n:~>20000:?n
    &   P$!n
      : ( <!n&1+!deficient:?deficient
        | !n&1+!perfect:?perfect
        | >!n&1+!abundant:?abundant
        )
    )
& out$(deficient !deficient perfect !perfect abundant !abundant)
& clk$:?t3
& out$(flt$(!t3+-1*!t2,2) sec)
);