"George Ogata" <george.ogata / gmail.com> writes: >> class Fixnum >> def divisors >> @d ||= (2..self/2).select{|i| self % i == 0 } > > You've probably already realized this, but this would be a lot faster: > > @d ||= (2..Math.sqrt(self)).select{|i| self % i == 0 } > >> end >> end You reminded me of http://butunclebob.com/ArticleS.UncleBob.PerformanceTuning -- Christian Neukirchen <chneukirchen / gmail.com> http://chneukirchen.org