Advertisement
dmemsm

Задача 6

Apr 13th, 2025
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. s = 0
  2.  
  3.  
  4. def f(x):
  5.     global s
  6.     s += 1
  7.     if s >= 25:
  8.         return 2*x + 1
  9.     else:
  10.         return f(2*x + 1)
  11.  
  12.  
  13. for n in range(1, 41):
  14.     s = 0
  15.     res = f(n)
  16.     if res == 536870911:
  17.         print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement