Пример #1
0
 def test_euler_totient(self):
     self.assertEqual(4, euler_totient(8))
     self.assertEqual(12, euler_totient(21))
     self.assertEqual(311040, euler_totient(674614))
     self.assertEqual(2354352, euler_totient(3435145))
Пример #2
0
 def test_euler_totient(self):
     self.assertEqual(4, euler_totient(8))
     self.assertEqual(12, euler_totient(21))
     self.assertEqual(311040, euler_totient(674614))
     self.assertEqual(2354352, euler_totient(3435145))
Пример #3
0
"""
Euler's totient function, also known as phi-function ϕ(n),
counts the number of integers between 1 and n inclusive,
which are coprime to n.
(Two numbers are coprime if their greatest common divisor (GCD) equals 1).
"""
from algorithms.maths import euler_totient

print(euler_totient(120))