xp = -5/14.0; for n in range(1,10): x = 3*xp + 5**(-(n-1)); xp = x; print "n: %3d, x_n: %g" % (n, x);