Farz0l1x

Untitled

Oct 20th, 2023
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. def f(n):
  2.     s = ""
  3.     while n > 0:
  4.         s += str(n % 6)
  5.         n //= 6
  6.     s = s[::-1]
  7.     return s
  8.  
  9. Min = 1000000000000000
  10. for N in range(1, 1000):
  11.     b = f(N)
  12.     if int(b) % 3 == 0:
  13.         b = b + f(N)[:2]
  14.     else:
  15.         b = b + f((int(b) % 3) * 10)
  16.     R = int(b, 6)
  17.     if R > 680:
  18.         Min = min(R, Min)
  19. print(Min)
Advertisement
Add Comment
Please, Sign In to add comment