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}}"
Perfect: 4 Deficient: 15043 Abundant: 4953
Last updated 11 months ago