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 2004

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

Search the Archive

Re: NestList

  • To: mathgroup at
  • Subject: [mg50583] Re: NestList
  • From: p-valko at (Peter Valko)
  • Date: Sat, 11 Sep 2004 06:44:33 -0400 (EDT)
  • References: <chpa26$jt6$>
  • Sender: owner-wri-mathgroup at


I am suggesting a solution:

fun1[x_,n_]:=(Print["now I know that n=",n];fun[x]);

now I know that n= 1
now I know that n= 2
now I know that n= 3



Namrata Khemka <namrata.khemka at> wrote in message news:<chpa26$jt6$1 at>...
> Hello everyone,
> I have a question regarding NestList function. 
> I am applying a function on the expression n times.
> NestList [function, expr, n]
> However in my function I would like to know what is the current value
> of n. In other words I would like to know what iteration it is on.
> Is this possible?
> Thanks in advance.
> Namrata Khemka

  • Prev by Date: Evaluating integral for magnetic field intensity using mathematica
  • Next by Date: Re: Cell write protect?
  • Previous by thread: Re: Re: NestList
  • Next by thread: Matrix calculation causes memory usage to jump