simple nest

*To*: mathgroup at smc.vnet.net*Subject*: [mg106661] simple nest*From*: Francisco Gutierrez <fgutiers2002 at yahoo.com>*Date*: Wed, 20 Jan 2010 06:50:01 -0500 (EST)

Dear group: I have a function that gets five arguments, two of which are fixed, and three vary. Its output are three numbers. So it can be nested, for example over some initial values. Say: Nest[func[arg1,arg2,#[[1]],#[[2]],#[[3]]]&,{init1,init2,init3},k] Simple enough, works well. Now I want to nest the same function, while the second non fixed argument changes at each step. I thought the "natural" way of doing this was: NestWhile[func[arg1,arg2,#[[1]],#[[2]],#[[3]]]&,{init1,init2,init3},UnsameQ[#[[2]]&,2], but this evidently does not work. So: in a NestWhile how do I create tests over parts of the outputs of a function? Thanks! Fg

**Follow-Ups**:**Re: Re: simple nest***From:*Leonid Shifrin <lshifr@gmail.com>

**Re: Re: simple nest***From:*DrMajorBob <btreat1@austin.rr.com>

**Re: simple nest***From:*Leonid Shifrin <lshifr@gmail.com>

**Re: simple nest***From:*Leonid Shifrin <lshifr@gmail.com>