doan logic 1
unknown
plain_text
3 years ago
161 B
6
Indexable
def f(x):
if x == 1:
return 2
return f(x - 1) * 2 - 1
t = int(input())
while t > 0:
t -= 1
x = int(input())
print(f(x))
Editor is loading...
def f(x):
if x == 1:
return 2
return f(x - 1) * 2 - 1
t = int(input())
while t > 0:
t -= 1
x = int(input())
print(f(x))