Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't figure out what I'm doing wrong here:

Table[Nest[# + 0.1 * -i *  #^2 &, 2, 1] , {i, 0, 0.5, 0.1}]
(* {2., 1.96, 1.92, 1.88, 1.84, 1.8} *)

The problem is that it keeps using 2 in the argument instead of the last result. Normally the first parameter is the starting point, when using the pure function.

The output should be something like

(* {2., 1.96, 1.883, 1.777, 1.651, 1.514} *)
share|improve this question
up vote 2 down vote accepted

Mathematica does do the right thing. For your purpose, Fold or FoldList should be used.

FoldList[#1 + 0.1*-#2*#1^2 &, 2.0, Range[0.1, 0.5, 0.1]]

Mathematica gives


Exactly what you want.

share|improve this answer
Okay thanks. I thought i was possible to use Nest(List) here, because if you nest 3 or 4 times fx you use the last result each time. But im still a rookie it appears :) – Punchline Dec 17 '13 at 9:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.