Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def give_n3(n10: int) -> str:
- n3 = ''
- while n10 > 0:
- n3 = str(n10 % 3) + n3
- n10 //= 3
- return n3
- min_r = 10**10
- for n in range(1, 100):
- st = give_n3(n)
- if n % 3 == 0:
- st += st[-2:]
- else:
- st += give_n3(st.count('2')*2 + st.count('1'))
- r = int(st, 3)
- if r % 2 == 0 and 220 < r < min_r:
- min_r = r
- print(min_r) # output: 222
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement