- To: mathgroup at smc.vnet.net
- Subject: [mg32542] Re: NestWhile
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sat, 26 Jan 2002 04:08:03 -0500 (EST)
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
Mathematica Training and Consulting
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"Tom De Vries" <tdevries at shop.westworld.ca> wrote in message
news:a2r3ih$9m8$1 at smc.vnet.net...
> I know this is a simple question, hope someone can help me out.....
> If I define the function
> f[n_] := If[EvenQ[n], n/2, 3n + 1]
> I can then apply NestList and generate a nice number loop......
> NestList[f, 7, 23]
> I want to use NestWhileList and stop when the generated number is a 1.
> do I do that?
> Thanks for the help,
> Tom De Vries
Prev by Date:
Re: Break up very long expression for C implementation
Next by Date:
Re: Indents, paragraphs, etc.
Previous by thread:
Next by thread: