from sympy import * n=Symbol('n') k=Symbol('k') a=1/(2**k)*tan(1/(2**k)) f=summation(a,(k,1,oo)) print(limit(f,n,oo))