from math import exp n = 1 I = 0.5*exp(1)-0.5 while n < 23: I = 0.5*exp(1)-(n+1)*I/2 n = n + 2 print(I)