> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/a/abundant_deficient_and_perfect_number_classifications.md).

# Abundant deficient and perfect number classifications

```ruby
func propdivsum(n) { n.sigma - n }

var h = Hash()
{|i| ++(h{propdivsum(i) <=> i} := 0) } << 1..20000
say "Perfect: #{h{0}}    Deficient: #{h{-1}}    Abundant: #{h{1}}"
```

#### Output:

```
Perfect: 4    Deficient: 15043    Abundant: 4953
```
