On Dec 5, 2005, at 9:38 AM, Mike Harris wrote:

>    each_divisor do |i|
>      return false if sum-i == self
>    end

Hmm, does that work?

I'm not trying to slander your code.  I'm actually asking because I  
think it's very elegant, if it's also correct.

You're code removes divisors one-by-one, but what if our divisors  
looked something like:

1, ..., 50, ..., 100

And the total sum was just 50 over the number we're testing?  The  
order we remove divisors might be significant then.  Am I right?

James Edward Gray II