-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2661.py
More file actions
27 lines (24 loc) · 678 Bytes
/
2661.py
File metadata and controls
27 lines (24 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def primo_despojado(n):
fatores = {}
i = 2
while i * i <= n:
if n % i:
i += 1
else:
if fatores.get(i):
fatores[i] += 1
else:
fatores[i] = 1
n //= i
if n > 1:
if fatores.get(n):
fatores[n] += 1
else:
fatores[n] = 1
return fatores
n = int(input())
fatores = primo_despojado(n)
primos_distintos = len(fatores)
combinacoes = 2**primos_distintos - primos_distintos - 1
print(combinacoes)
# analise combinatoria resolvida com auxilio https://danielsaad.com/maratona/assets/22-maratona-de-programacao/editorial/despojados.pdf