From: Luke Ivers Date: 2007-02-10T06:13:36+09:00 Subject: Re: [QUIZ] One-Liners (#113) ------=_Part_46420_4066280.1171055613292 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/9/07, Luke Ivers wrote: > > > > > * Given a wondrous number Integer, produce the sequence (in an > Array). A > > wondrous number is a number that eventually reaches one, if you apply > the > > following rules to build a sequence from it. If the current number in > the > > sequence is even, the next number is that number divided by two. When > the > > current number is odd, multiply that number by three and add one to get > > the next > > number in the sequence. Therefore, if we start with the wondrous number > > 15, the > > sequence is [15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, > > 4, 2, > > 1]. > > > > > One final question: you say "given a wondrous number"... does this mean > that > the input is guaranteed to be wondrous, and we therefore don't need to > check > it, or does the solution need to include a check to make sure that it is > indeed a wondrous number? > Never mind. ------=_Part_46420_4066280.1171055613292--