Re: "Alternating" function
- To: mathgroup at smc.vnet.net
- Subject: [mg63281] Re: "Alternating" function
- From: "Borut Levart" <BoLe79 at gmail.com>
- Date: Thu, 22 Dec 2005 00:04:44 -0500 (EST)
- References: <doamp5$em8$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Module[{i = 1}, Nest[x + ((-1)^i++)*f[#] &, x + f[x], 4] ] This does what you desire to do. Note the increment of i by one in every Nest-iteration, and so an alternative sign before f. For a shift in signs by one, change the starting value of i in Module by one. Greetings from Slovenia, Borut Levart