mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-22 11:56:33 +03:00
12 lines
208 B
Python
Vendored
12 lines
208 B
Python
Vendored
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"))
|