Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def func(num, base):
- num_copy = num
- num_str = ''
- while num > 0:
- num_str += str(num % base)
- num //= base
- num_str = str(num_copy % base) + num_str
- R = 0
- for i in range(len(num_str)):
- R += int(num_str[i])*(base**i)
- return R
- for i in range(1, 10000000):
- res = func(i, 3)
- if (res >= 1000) and (res < 10000):
- print(res)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement