First commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from Cryptotools.Utils.utils import gcd
|
||||
|
||||
|
||||
# https://oeis.org/A000010
|
||||
def phi(n):
|
||||
"""
|
||||
This function count all phi(n)
|
||||
|
||||
Args:
|
||||
n (integer): it's the phi(n) value
|
||||
|
||||
Returns:
|
||||
Return the phi(n)
|
||||
"""
|
||||
y = 1
|
||||
for i in range(2, n):
|
||||
if gcd(n, i) == 1:
|
||||
y += 1
|
||||
return y
|
||||
|
||||
Reference in New Issue
Block a user