Advertisement
Farz0l1x

Untitled

Feb 27th, 2024
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. maxR = 0
  2. for n in range(1, 1000):
  3.     b = bin(n)[2:]
  4.     if n % 3 == 0:
  5.         b = b.replace('0', '11')
  6.     else:
  7.         b = b.replace('1', '10')
  8.     R = int(b, 2)
  9.     if R < 161:
  10.         maxR = max(maxR, R)
  11. print(maxR)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement