g[x_]:=((i - 1/i)*x + (1/i)*(x/2))/2;

I want to find the following list

NumberForm[NestList[g, 0.8, 20], 16];

But don't know how to use "Do" for the values of i= {1,2,3,4,.....} varies with each step

Help would be very welcome

  • $\begingroup$ Maybe g[x_, i_] := ((i - 1/i) x + (1/i) (x/2))/2; FoldList[g, 0.8, Range[20]] $\endgroup$
    – BlacKow
    Apr 13, 2016 at 17:05
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – user9660
    Apr 13, 2016 at 17:22

1 Answer 1


I assume that you want to obtain following list

{0.8,g[0.8 (*with i=1*)],g[g[0.8] (*with i=2*)]...}

One way:

g[x_, i_] := ((i - 1/i) x + (1/i) (x/2))/2;
FoldList[g, 0.8, Range[20]]

Another way, if you really want to use NestList

g2[{x_, i_}] := {((i - 1/i) x + (1/i) (x/2))/2, i + 1};
First@Transpose@NestList[g2, {0.8, 1}, 20]
  • $\begingroup$ Thanks a lot Dear, but I think the sequence be look like {0.8,g[0.8 (with i=1)],g[g[0.8 (with i=1)] (with i=2)]...}, Is it the same one or will be different??? $\endgroup$
    – Marwat
    Apr 15, 2016 at 17:46
  • $\begingroup$ @Marwat yes it is the same one. I just dropped there "with i=1" in my description. $\endgroup$
    – BlacKow
    Apr 15, 2016 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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