From: Mathieu Bouchard Date: 2001-03-10T01:45:21+09:00 Subject: [ruby-talk:12337] Re: ...and the challenge On Sat, 10 Mar 2001, Robert Feldt wrote: > Hi again, > Yes I forgot the challenge: > Write a nice, fast and small Ruby program for generating the n > first numbers in the Hamming sequence defined as > "List of all numbers, in ascending order, of the form > (2**i)*(3**j)*(5**k) for i,j,k at least 0. It begins like > 1 2 3 4 5 6 8 9 10 12 15 16 18 ..." Here's one for a start. it's not fast though. def suck(i,x); while x%i==0; x/=i; end; x; end n=1; loop do p n if 1 == (suck 2, suck 3, suck 5, n); n+=1; end matju