Use memoization. See here for a description of the memoization in general, and here for its Mathematica implementation. This will avoid having to recalculate all the previous values to determine the next one:
Clear[x, T, a, b]
T[x_] := T[x] = Piecewise[{{1 - x, 0 <= x < 1/7}, {(x + 6)/7, 1/7 <= x <= 1}}]
a[n_] := a[n] = n/(n + 5)^5
b[n_] := b[n] = (2 n/7 n + 5)^(1/2)
x[0] = 0.9;
x[n_] := x[n] = (1 - a[n - 1])*T[x[n - 1]] +
a[n - 1]*T[(1 - b[n - 1])*x[n - 1] + b[n - 1] T[x[n - 1]]]
Table[{i, x[i]}, {i, 0, 50}]
(* Out: {{0, 0.9}, {1, 0.985714}, {2, 0.997831}, {3, 0.999571},
{4, 0.999847}, {5, 0.99991}, {6, 0.999937}, {7, 0.999954},
{8, 0.999965}, {9, 0.999973}, {10, 0.999979}, {11, 0.999984}, {12, 0.999987},
{13, 0.99999}, {14, 0.999992}, {15, 0.999993}, {16, 0.999994}, {17, 0.999995},
{18, 0.999996}, {19, 0.999997}, {20, 0.999997}, {21, 0.999998},
{22, 0.999998}, {23, 0.999998}, {24, 0.999998}, {25, 0.999999}, {26, 0.999999},
{27, 0.999999}, {28, 0.999999}, {29, 0.999999}, {30, 0.999999}, {31, 0.999999},
{32, 0.999999}, {33, 0.999999}, {34, 1.}, {35, 1.}, {36, 1.}, {37, 1.}, {38, 1.},
{39, 1.}, {40, 1.}, {41, 1.}, {42, 1.}, {43, 1.}, {44, 1.}, {45, 1.}, {46, 1.},
{47, 1.}, {48, 1.}, {49, 1.}, {50, 1.}}
*)
Also, avoid loops (For
, Do
), but rather use vector constructs (e.g. Table
, Map
). The Table
above now calculates almost instantaneously.
If you are interested in how far from exactly $1$ the value of $x(i)$ is for a certainly value of $i$, then you may resort to arbitrary precision calculations, after changing the precision of your starting point x[0]
. For instance, using 20-digit precision calculations:
x[0] = 0.9`20;
DiscretePlot[
Round@Log10[Abs[x[i] - 1]], {i, 0, 50},
Frame -> True, LabelStyle -> {Black, 14},
FrameLabel -> {"iteration number", "Log(error)"}
]

{}
while typing up your question). As a first suggestion, if you're using loops, you're probably doing something wrong. $\endgroup$ – Ben Kalziqi Jun 16 '16 at 18:57(2 n/7 n + 5)
? Is this merely5 + 2/7 = 37/7
? Likewise, do you need the second conditional in yourPiecewise
? And why define all your functions, e.g.,a
, when you can merely compute that inx
? And by all means replaceFor
withTable
and eliminatePrint
. $\endgroup$ – David G. Stork Jun 16 '16 at 19:02Table
, or maybeMap
. The timing on this function is terrible; moreover, why are you convinced that this even converges to 1 after a finite iterations? $\endgroup$ – Ben Kalziqi Jun 16 '16 at 19:25