Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(n):
- s = ""
- while n > 0:
- s += str(n % 3)
- n //= 3
- s = s[::-1]
- return s
- Max = 0
- for n in range(1, 100000):
- b = f(n)
- if n % 4 == 0:
- b = b + b[-3:]
- else:
- b = b + f((n % 4) * 4)
- R = int(b, 3)
- if R > 127:
- Max = max(Max, R)
- print(Max)
Advertisement
Add Comment
Please, Sign In to add comment