Advertisement
Spocoman

04. Sequence 2k+1

Dec 27th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.09 KB | None | 0 0
  1. num = int(input())
  2. sum = 1
  3.  
  4. while num >= sum:
  5.     print(sum)
  6.     sum = sum * 2 + 1
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement