On 12/4/05, James Edward Gray II <james / grayproductions.net> wrote: > On Dec 4, 2005, at 7:27 AM, Hampton wrote: > > > SO... I thought of a way to speed up the algorithm a lot! So, with a > > *few* more optimizations, here's the weirdo_fast algorithm. > > > > ------------------------------------------------------- > > > > def weirdo_fast(max) > > list = [ 70,836,4030,5830,7192,7912,9272,10792,17272,45356,73616, # > > 83312,91388,113072,243892,254012,338572,343876,388076, # > > 519712,539744,555616,682592,786208,1188256,1229152,1713592, # > > 1901728,2081824,2189024,3963968 ] > > list.each do |num| > > puts num if num <= max > > end > > if max > list[list.size-1] then weirdo_exhaustive(list[list.size-1], > > max) end > > end > > > > ----------------------------------------------------- > > > > A little faster, eh? > > Bingo. > > I was actually thinking of screen scraping them from on of the > encyclopedias mentioned in the quiz thread, but I like this even better. > > Nice job. I don't know, I think this is cheating. Plus he is missing a bunch of weird numbers in his list. Ryan