mirror of
https://github.com/Hizenberg469/Python-tutorial.git
synced 2026-04-19 23:12:24 +03:00
14 lines
197 B
Python
14 lines
197 B
Python
def j(n):
|
|
if n == 1:
|
|
return 1
|
|
|
|
if n % 2 == 0 :
|
|
return 2 * j(n/2) - 1
|
|
else:
|
|
return 2 * j((n-1)/2) + 1
|
|
|
|
|
|
for i in range(1,33):
|
|
print(f'{i} : {j(i)}')
|
|
|