import math n = 5 x = 2.5 e = 0 for i in range(1, n + 1): e += (x + math.cos(i - x)) / 2**i print(f"Сумма E = {e}")