IterationList Command
From GeoGebra Manual
- IterationList[ <Function>, <Start Value>, <Number of Iterations n> ]
- Gives you a list of length n+1 whose elements are iterations of the function starting with the start value.
- Example: After defining
f(x) = x^2
the commandIterationList[f, 3, 2]
gives you the list {3, 9, 81}.
- IterationList[ <Expression>, <Variable Name>, ..., <Start Values>, <Number of Iterations> ]
- Gives you a list of length n+1 whose elements are iterations of the expression starting with the start value. Variables in the expression are substtituted by last elements of the list in each iteration. There should be at least as many start values as there are variables, otherwise the result is undefined.
Example: Let A,B be points. Then
IterationList[Midpoint[A, C], C,{B},3]
internally computes values C0=B,
C1=Midpoint[A, C0] C2=Midpoint[A, C1] C3=Midpoint[A, C2]
and yields {C0, C1, C2, C3}. Hence for A=(0,0) and B=(8,0) the result will be {(8,0), (4,0), (2,0), (1,0)}.Example: Let f_0,f_1 be numbers.
IterationList[a+b, a,b,{f_0,f_1},5]
fills the first 2 values of the resulting list from the start values. Afterwards the values are computed as
f2=f0+f1, f3=f1+f2, f4=f2+f3, f5=f3+f4.
For f_0=f_1=1 the resulting list will be {1,1,2,3,5,8}. Note: See also Iteration_Command.