mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-30 23:13:42 +03:00
12 lines
208 B
Python
12 lines
208 B
Python
def to_3(n):
|
|
s = ""
|
|
while n:
|
|
s += str(n % 3)
|
|
n //= 3
|
|
return s[::-1]
|
|
|
|
|
|
r = 2 * 729**1021 - 2 * 243**1022 + 81**1023 - 2 * 27**1024 - 1025
|
|
s = to_3(r)
|
|
print(s.count("0"))
|