def test(p): num=(2**p)-1 ans=(format(num,'b')) ans_1=list(ans) sum=0 for i in range(len(ans_1)): sum+=int(ans_1[i]) print(sum) test(p)