#aaaaaaaaaaaaaaaaaaaaaaaaa import scipy.special as f; def zeta(s): return f.zeta(s) x,n=map(int,input().split()) if x==1: print((pow(2,n+1)-1)/(pow(2,n+1))) else: if n==1: print("0.5") elif n==2: print("0.644934033") else: print((n-1)*zeta(n)-(n-2)*zeta(n-1))