Farz0l1x

Untitled

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