From: Will Date: 2008-10-18T07:09:30+09:00 Subject: Re: Counting ------=_Part_52358_22216041.1224281411686 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Can you elaborate a bit more? Are you looking for all multiples of 2 and 6 under 1000? Mathematically, that's just all multiples of 6 under 1000, so you could do something like n=6 i = 1 array = [] while n*i < 1000 do array.push(n*i) i += 1 end p array I'm not sure what you're asking, but maybe if you can give an example of what you're looking for I can be more useful. On Fri, Oct 17, 2008 at 4:44 PM, Tom Clarke wrote: > How would i go about making Ruby count to say 1000 usin only multiples > of say 2 and 6. Then i am looking to add all of the outputted numbers. > Can anyone help > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_52358_22216041.1224281411686--