for i in range(1, 50):
    x[i + 1] = fractions.Fraction(13 * x[i] / 3) - fractions.Fraction(4 * x
        [i - 1] / 3)
print((float(x[i + 1]), 3 ** -(i + 1), x[i + 1] - 3 ** -(i + 1)))
printRecurrence()
Recurrence Relations in python