(*Created by Rafael Luís: rafaelluis@netmadeira.com
 2016-09-11: adapted for Mathematica v.10 by Ross Moore *)

(* Times series for logistic map *)
Clear[h,x];
f[x_,h_]=h(x-(x^2));
(*recursive definition of the funtion*)
f[x_,h_,0]:=x;
f[x_,h_,n_]:=f[f[x,h,n-1],h]

f[x,1,2]

aa={};
x0=0.5 ; (*initial Value*)
h=3.828;    (*Parameter*)
iterates=150;
Do[AppendTo[aa,f[x0,h,j]],{j,1,iterates}];
imagem11=ListPlot[aa,Joined->True,PlotRange->{0,1},AxesLabel->{"n","(Subscript[x, n])"},PlotLabel->StyleForm["Diagram (n,x(n)) for μ=3.828"],PlotStyle->{Thickness[.002],RGBColor[1,0,0]}]