logistic[iter_, last_] :=
     Module[
       {lst0 = Table[{i,0.4}, {i,2.9, 3.9, 0.01}], f, g},
               f[lst_] := {lst[[1]], lst[[1]](1-lst[[2]])lst[[2]]};
               g[lst_] := Take[NestList[f,lst,iter], -last];
               ListPlot[Flatten[Map[g,lst0],1]]
           ]