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
- for n in range(1, 100000):
- n = f(n)
- if int(n) % 4 == 0:
- n = n + n[-3:]
- else:
- n = n + f((int(n) % 4) * 4)
- R = int(n, 3)
- if R < 127:
- print(R)
Advertisement
Add Comment
Please, Sign In to add comment