Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A = []
- for n in range(1000):
- b = bin(n)[2:]
- if int(b) % 3 == 0:
- while '0' in b:
- b = b.replace('0', '11')
- else:
- for i in range(len(b)):
- if int(b[i]) == 1:
- b = b.replace(b[i], '10')
- R = int(b, 2)
- if R <= 161:
- A.append(R)
- print(max(A))
Advertisement
Add Comment
Please, Sign In to add comment