Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive


  • To: mathgroup at
  • Subject: [mg32519] NestWhile
  • From: Tom De Vries <tdevries at>
  • Date: Fri, 25 Jan 2002 02:57:49 -0500 (EST)
  • Sender: owner-wri-mathgroup at


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.  How
do I do that?

Thanks for the help,


Tom De Vries 

  • Prev by Date: Re: Magic Matrices
  • Next by Date: Indents, paragraphs, etc.
  • Previous by thread: Re: Change of Variables
  • Next by thread: RE: NestWhile