from __future__ import print_function from math import exp N = 50 x1 = 190 x2 = 260 xpp = x1 xp = x2 for n in range(3, N): x = 0.25*xp + 1.25*xpp print('x[%d]: %g' % (n, x)) xpp = xp xp = x